From 766f6447e072c64d2a82fe948dfd759319997305 Mon Sep 17 00:00:00 2001 From: Justin Aquadro Date: Tue, 2 Jul 2013 21:46:25 -0400 Subject: [PATCH] If exposing boolean properties, it's simpler to also keep the internal representation boolean. --- SubstrateCS/Source/Level.cs | 42 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/SubstrateCS/Source/Level.cs b/SubstrateCS/Source/Level.cs index 5da3205..f8bd813 100644 --- a/SubstrateCS/Source/Level.cs +++ b/SubstrateCS/Source/Level.cs @@ -10,21 +10,21 @@ namespace Substrate /// public class GameRules : ICopyable { - private string _commandBlockOutput = "true"; - private string _doFireTick = "true"; - private string _doMobLoot = "true"; - private string _doMobSpawning = "true"; - private string _doTileDrops = "true"; - private string _keepInventory = "false"; - private string _mobGriefing = "true"; + private bool _commandBlockOutput = true; + private bool _doFireTick = true; + private bool _doMobLoot = true; + private bool _doMobSpawning = true; + private bool _doTileDrops = true; + private bool _keepInventory = false; + private bool _mobGriefing = true; /// /// Gets or sets whether or not actions performed by command blocks are displayed in the chat. /// public bool CommandBlockOutput { - get { return _commandBlockOutput == "true"; } - set { _commandBlockOutput = value ? "true" : "false"; } + get { return _commandBlockOutput; } + set { _commandBlockOutput = value; } } /// @@ -32,8 +32,8 @@ namespace Substrate /// public bool DoFireTick { - get { return _doFireTick == "true"; } - set { _doFireTick = value ? "true" : "false"; ; } + get { return _doFireTick; } + set { _doFireTick = value; } } /// @@ -41,8 +41,8 @@ namespace Substrate /// public bool DoMobLoot { - get { return _doMobLoot == "true"; } - set { _doMobLoot = value ? "true" : "false"; ; } + get { return _doMobLoot; } + set { _doMobLoot = value; } } /// @@ -50,8 +50,8 @@ namespace Substrate /// public bool DoMobSpawning { - get { return _doMobSpawning == "true"; } - set { _doMobSpawning = value ? "true" : "false"; ; } + get { return _doMobSpawning; } + set { _doMobSpawning = value; } } /// @@ -59,8 +59,8 @@ namespace Substrate /// public bool DoTileDrops { - get { return _doTileDrops == "true"; } - set { _doTileDrops = value ? "true" : "false"; ; } + get { return _doTileDrops; } + set { _doTileDrops = value; } } /// @@ -68,8 +68,8 @@ namespace Substrate /// public bool KeepInventory { - get { return _keepInventory == "true"; } - set { _keepInventory = value ? "true" : "false"; ; } + get { return _keepInventory; } + set { _keepInventory = value; } } /// @@ -77,8 +77,8 @@ namespace Substrate /// public bool MobGriefing { - get { return _mobGriefing == "true"; } - set { _mobGriefing = value ? "true" : "false"; ; } + get { return _mobGriefing; } + set { _mobGriefing = value; } } #region ICopyable Members