예제 #1
0
 protected AbstractLiquid(int volume, string type, string name)
     : base(name)
 {
     Configuration = ConfigurationManager.GetLiquidConfiguration(type);
     Type          = type;
     this.volume   = volume;
 }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }
예제 #5
0
        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;
        }
예제 #6
0
        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;
        }
예제 #7
0
 protected AbstractLiquid(SaveData data) : base(data)
 {
     Type          = data.GetStringValue(SaveKeyLiquidType);
     Configuration = ConfigurationManager.GetLiquidConfiguration(Type);
     volume        = data.GetIntValue(SaveKeyVolume);
 }