If exposing boolean properties, it's simpler to also keep the internal representation boolean.

This commit is contained in:
Justin Aquadro 2013-07-02 21:46:25 -04:00
parent af639918b9
commit 766f6447e0

View file

@ -10,21 +10,21 @@ namespace Substrate
/// </summary> /// </summary>
public class GameRules : ICopyable<GameRules> public class GameRules : ICopyable<GameRules>
{ {
private string _commandBlockOutput = "true"; private bool _commandBlockOutput = true;
private string _doFireTick = "true"; private bool _doFireTick = true;
private string _doMobLoot = "true"; private bool _doMobLoot = true;
private string _doMobSpawning = "true"; private bool _doMobSpawning = true;
private string _doTileDrops = "true"; private bool _doTileDrops = true;
private string _keepInventory = "false"; private bool _keepInventory = false;
private string _mobGriefing = "true"; private bool _mobGriefing = true;
/// <summary> /// <summary>
/// Gets or sets whether or not actions performed by command blocks are displayed in the chat. /// Gets or sets whether or not actions performed by command blocks are displayed in the chat.
/// </summary> /// </summary>
public bool CommandBlockOutput public bool CommandBlockOutput
{ {
get { return _commandBlockOutput == "true"; } get { return _commandBlockOutput; }
set { _commandBlockOutput = value ? "true" : "false"; } set { _commandBlockOutput = value; }
} }
/// <summary> /// <summary>
@ -32,8 +32,8 @@ namespace Substrate
/// </summary> /// </summary>
public bool DoFireTick public bool DoFireTick
{ {
get { return _doFireTick == "true"; } get { return _doFireTick; }
set { _doFireTick = value ? "true" : "false"; ; } set { _doFireTick = value; }
} }
/// <summary> /// <summary>
@ -41,8 +41,8 @@ namespace Substrate
/// </summary> /// </summary>
public bool DoMobLoot public bool DoMobLoot
{ {
get { return _doMobLoot == "true"; } get { return _doMobLoot; }
set { _doMobLoot = value ? "true" : "false"; ; } set { _doMobLoot = value; }
} }
/// <summary> /// <summary>
@ -50,8 +50,8 @@ namespace Substrate
/// </summary> /// </summary>
public bool DoMobSpawning public bool DoMobSpawning
{ {
get { return _doMobSpawning == "true"; } get { return _doMobSpawning; }
set { _doMobSpawning = value ? "true" : "false"; ; } set { _doMobSpawning = value; }
} }
/// <summary> /// <summary>
@ -59,8 +59,8 @@ namespace Substrate
/// </summary> /// </summary>
public bool DoTileDrops public bool DoTileDrops
{ {
get { return _doTileDrops == "true"; } get { return _doTileDrops; }
set { _doTileDrops = value ? "true" : "false"; ; } set { _doTileDrops = value; }
} }
/// <summary> /// <summary>
@ -68,8 +68,8 @@ namespace Substrate
/// </summary> /// </summary>
public bool KeepInventory public bool KeepInventory
{ {
get { return _keepInventory == "true"; } get { return _keepInventory; }
set { _keepInventory = value ? "true" : "false"; ; } set { _keepInventory = value; }
} }
/// <summary> /// <summary>
@ -77,8 +77,8 @@ namespace Substrate
/// </summary> /// </summary>
public bool MobGriefing public bool MobGriefing
{ {
get { return _mobGriefing == "true"; } get { return _mobGriefing; }
set { _mobGriefing = value ? "true" : "false"; ; } set { _mobGriefing = value; }
} }
#region ICopyable<GameRules> Members #region ICopyable<GameRules> Members