public override void UpdateUniqueProperties(string i_Key, string i_Value) { const int trueValue = 1; const int falseValue = 2; int trunkCool; if (i_Key == k_IsTrunkCooledKey) { int.TryParse(i_Value, out trunkCool); if (trunkCool > falseValue || trunkCool < trueValue) { throw new ValueOutOfRangeException(0, 1); } this.m_IsTrunkCooled = trunkCool == trueValue; } else if (i_Key == k_TrunkCapacityKey) { this.m_TrunkCapacity = LogicUtils.NumericValueValidation(i_Value, float.MaxValue); } else { throw new ArgumentException("Invalid key"); } }
public override void UpdateUniqueProperties(string i_Key, string i_Value) { if (i_Key == k_EngineVolumeKey) { this.m_EngineVolume = (int)LogicUtils.NumericValueValidation(i_Value, int.MaxValue); } else if (i_Key == k_LicenseTypeKey) { this.m_LicenseType = LogicUtils.EnumValidation <eLicenseType>(i_Value, i_Key); } else { throw new ArgumentException("Invalid key"); } }