protected bool Equals(GameRuleObject other) { if (this is GameRuleString && other is GameRuleString) { return(Equals(((GameRuleString)this).ValueString, ((GameRuleString)other).ValueString)); } if (this is GameRuleDouble && other is GameRuleDouble) { return(Equals(((GameRuleDouble)this).ValueDouble, ((GameRuleDouble)other).ValueDouble)); } if (this is GameRuleInteger && other is GameRuleInteger) { return(Equals(((GameRuleInteger)this).ValueInt, ((GameRuleInteger)other).ValueInt)); } if (this is GameRuleBoolean && other is GameRuleBoolean) { return(Equals(((GameRuleBoolean)this).ValueBool, ((GameRuleBoolean)other).ValueBool)); } return(false); }
public void Add(string ruleName, GameRuleObject ruleValue) => GameRuleDictionary.Add(ruleName, ruleValue);