the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at master 56 lines 1.3 kB view raw
1#pragma once 2 3class GameRules 4{ 5private: 6 class GameRule 7 { 8 private: 9 wstring value; 10 bool booleanValue; 11 int intValue; 12 double doubleValue; 13 14 public: 15 GameRule(const wstring &startValue); 16 17 void set(const wstring &newValue); 18 wstring get(); 19 bool getBoolean(); 20 int getInt(); 21 double getDouble(); 22 }; 23 24public: 25 // 4J: Originally strings 26 // default rules 27 static const int RULE_DOFIRETICK; 28 static const int RULE_MOBGRIEFING; 29 static const int RULE_KEEPINVENTORY; 30 static const int RULE_DOMOBSPAWNING; 31 static const int RULE_DOMOBLOOT; 32 static const int RULE_DOTILEDROPS; 33 static const int RULE_COMMANDBLOCKOUTPUT; 34 static const int RULE_NATURAL_REGENERATION; 35 static const int RULE_DAYLIGHT; 36 37private: 38 unordered_map<wstring, GameRule *> rules; 39 40public: 41 GameRules(); 42 ~GameRules(); 43 44 bool getBoolean(const int rule); 45 46 // 4J: Removed unused functions 47 /*void set(const wstring &ruleName, const wstring &newValue); 48 void registerRule(const wstring &name, const wstring &startValue); 49 wstring get(const wstring &ruleName); 50 int getInt(const wstring &ruleName); 51 double getDouble(const wstring &ruleName); 52 CompoundTag *createTag(); 53 void loadFromTag(CompoundTag *tag); 54 vector<wstring> *getRuleNames(); 55 bool contains(const wstring &rule);*/ 56};