protected AbstractLiquid(int volume, string type, string name) : base(name) { Configuration = ConfigurationManager.GetLiquidConfiguration(type); Type = type; this.volume = volume; }
protected AbstractSteam(SaveData data) : base(data) { liquidType = data.GetStringValue(SaveKeyLiquidType); configuration = ConfigurationManager.GetLiquidConfiguration(liquidType); if (configuration == null) { throw new ApplicationException($"Unable to find liquid configuration for liquid type \"{liquidType}\"."); } volume = data.GetIntValue(SaveKeyVolume); }
public OilLiquid(SaveData data) : base(data) { configuration = ConfigurationManager.GetLiquidConfiguration(LiquidType); ignitionTemperature = GetCustomInt(CustomValueIgnitionTemperature); BurningTemperature = GetCustomInt(CustomValueBurningTemperature); heatSpeed = GetCustomInt(CustomValueHeatSpeed); burningRate = GetCustomDouble(CustomValueBurningRate); volume = data.GetIntValue(SaveKeyVolume); }
private static string GetCustomConfigurationValue(ILiquidConfiguration configuration, string key) { var stringValue = configuration.CustomValues .FirstOrDefault(value => string.Equals(value.Key, key))?.Value; if (string.IsNullOrEmpty(stringValue)) { throw new ApplicationException($"Custom value {key} not found in the configuration for \"{WaterLiquid.LiquidType}\"."); } return(stringValue); }
protected AbstractSteam(int volume, string liquidType, string name) : base(name) { this.liquidType = liquidType; configuration = ConfigurationManager.GetLiquidConfiguration(liquidType); if (configuration == null) { throw new ApplicationException($"Unable to find liquid configuration for liquid type \"{liquidType}\"."); } this.volume = volume; }
public OilLiquid(int volume) : base("Oil") { configuration = ConfigurationManager.GetLiquidConfiguration(LiquidType); ignitionTemperature = GetCustomInt(CustomValueIgnitionTemperature); BurningTemperature = GetCustomInt(CustomValueBurningTemperature); heatSpeed = GetCustomInt(CustomValueHeatSpeed); burningRate = GetCustomDouble(CustomValueBurningRate); this.volume = volume; }
protected AbstractLiquid(SaveData data) : base(data) { Type = data.GetStringValue(SaveKeyLiquidType); Configuration = ConfigurationManager.GetLiquidConfiguration(Type); volume = data.GetIntValue(SaveKeyVolume); }