2026-03-03 03:04:10 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
class GameRules
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
class GameRule
|
|
|
|
|
{
|
|
|
|
|
private:
|
|
|
|
|
wstring value;
|
|
|
|
|
bool booleanValue;
|
|
|
|
|
int intValue;
|
|
|
|
|
double doubleValue;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
GameRule(const wstring &startValue);
|
|
|
|
|
|
|
|
|
|
void set(const wstring &newValue);
|
|
|
|
|
wstring get();
|
|
|
|
|
bool getBoolean();
|
|
|
|
|
int getInt();
|
|
|
|
|
double getDouble();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
// 4J: Originally strings
|
|
|
|
|
// default rules
|
|
|
|
|
static const int RULE_DOFIRETICK;
|
|
|
|
|
static const int RULE_MOBGRIEFING;
|
|
|
|
|
static const int RULE_KEEPINVENTORY;
|
|
|
|
|
static const int RULE_DOMOBSPAWNING;
|
|
|
|
|
static const int RULE_DOMOBLOOT;
|
|
|
|
|
static const int RULE_DOTILEDROPS;
|
|
|
|
|
static const int RULE_COMMANDBLOCKOUTPUT;
|
|
|
|
|
static const int RULE_NATURAL_REGENERATION;
|
|
|
|
|
static const int RULE_DAYLIGHT;
|
|
|
|
|
|
|
|
|
|
public:
|
2026-03-06 02:11:18 +07:00
|
|
|
GameRules() = default;
|
|
|
|
|
~GameRules() = default;
|
2026-03-03 03:04:10 +08:00
|
|
|
|
|
|
|
|
bool getBoolean(const int rule);
|
|
|
|
|
};
|