Exemple #1
0
 void OnRoundEnd()
 {
     GasReactions.ResetReactionList();
     AtmosThread.ClearAllNodes();
     inGameNewPipes.Clear();
     StopSimulation();
 }
Exemple #2
0
 private void Stop()
 {
     atmosThread.StopThread();
     GasReactions.ResetReactionList();
     simulation.ClearUpdateList();
     inGameNewPipes.Clear();
     inGameFireAlarms.Clear();
     reactionManagerList.Clear();
 }
        private static bool ReactionMoleCheck(GasReactions gasReaction, GasMix gasMix)
        {
            foreach (var data in gasReaction.GasReactionData)
            {
                if (gasMix.GetMoles(data.Key) == 0)
                {
                    return(true);
                }

                if (gasMix.GetMoles(data.Key) < data.Value.minimumMolesToReact)
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #4
0
 public static void RemoveReaction(GasReactions gasReaction)
 {
     gasReactions.Remove(gasReaction);
     SetAllToNull();
 }
Exemple #5
0
        public static void SetUpReactions()
        {
            gasReactions.Clear();

            #region TritiumFire

            TritiumFire = new GasReactions(

                reaction: new TritiumFireReaction(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Tritium,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                },

                {
                    Gas.Oxygen,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                }
            },

                minimumTemperature: 373.15f,
                maximumTemperature: 10000000000f,
                minimumPressure: 0f,
                maximumPressure: 10000000000f,
                minimumMoles: 0.01f,
                maximumMoles: 10000000000f,
                energyChange: 0f,
                addToBaseReactions: true
                );

            #endregion

            #region FreonFire

            FreonFire = new GasReactions(

                reaction: new FreonFireReaction(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Oxygen,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                },

                {
                    Gas.Freon,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                }
            },

                minimumTemperature: 1f,
                maximumTemperature: 10000000000f,
                minimumPressure: 0f,
                maximumPressure: 10000000000f,
                minimumMoles: 0.01f,
                maximumMoles: 10000000000f,
                energyChange: 0f,
                addToBaseReactions: true
                );

            #endregion

            #region Fusion

            Fusion = new GasReactions(

                reaction: new FusionReaction(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Tritium,
                    new GasReactionData()
                    {
                        minimumMolesToReact = AtmosDefines.FUSION_TRITIUM_MOLES_USED
                    }
                },

                {
                    Gas.Plasma,
                    new GasReactionData()
                    {
                        minimumMolesToReact = AtmosDefines.FUSION_MOLE_THRESHOLD
                    }
                },

                {
                    Gas.CarbonDioxide,
                    new GasReactionData()
                    {
                        minimumMolesToReact = AtmosDefines.FUSION_MOLE_THRESHOLD
                    }
                }
            },

                minimumTemperature: AtmosDefines.FUSION_TEMPERATURE_THRESHOLD,
                maximumTemperature: 10000000000f,
                minimumPressure: 0f,
                maximumPressure: 10000000000f,
                minimumMoles: 0.01f,
                maximumMoles: 10000000000f,
                energyChange: 0f,
                addToBaseReactions: true
                );

            #endregion

            #region NO2

            NO2Form = new GasReactions(

                reaction: new NO2Formation(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Oxygen,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 10f
                    }
                },

                {
                    Gas.Nitrogen,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 20f
                    }
                },

                {
                    Gas.BZ,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 5f
                    }
                }
            },

                minimumTemperature: 200f,
                maximumTemperature: 250f,
                minimumPressure: 0f,
                maximumPressure: 10000000000f,
                minimumMoles: 0.01f,
                maximumMoles: 10000000000f,
                energyChange: 0f,
                addToBaseReactions: true
                );

            NO2Decomp = new GasReactions(

                reaction: new NO2Decomposition(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.NitrousOxide,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                }
            },

                minimumTemperature: AtmosDefines.N2O_DECOMPOSITION_MIN_ENERGY,
                maximumTemperature: 10000000000f,
                minimumPressure: 0f,
                maximumPressure: 10000000000f,
                minimumMoles: 0.01f,
                maximumMoles: 10000000000f,
                energyChange: 0f,
                addToBaseReactions: true
                );

            #endregion

            #region Nitryl

            NitrylForm = new GasReactions(

                reaction: new NitrylFormation(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Oxygen,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 10f
                    }
                },

                {
                    Gas.Nitrogen,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 20f
                    }
                },

                {
                    Gas.BZ,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 5f
                    }
                }
            },

                minimumTemperature: 600f,
                maximumTemperature: 10000000000f,
                minimumPressure: 0f,
                maximumPressure: 10000000000f,
                minimumMoles: 0.01f,
                maximumMoles: 10000000000f,
                energyChange: 0f,
                addToBaseReactions: true
                );

            #endregion

            #region BZ

            BZForm = new GasReactions(

                reaction: new BZFormation(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.NitrousOxide,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 10f
                    }
                },

                {
                    Gas.Plasma,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 10f
                    }
                }
            },

                minimumTemperature: 1f,
                maximumTemperature: 10000000000f,
                minimumPressure: 0f,
                maximumPressure: 10000000000f,
                minimumMoles: 0.01f,
                maximumMoles: 10000000000f,
                energyChange: 0f,
                addToBaseReactions: true
                );

            #endregion

            #region Freon

            FreonForm = new GasReactions(

                reaction: new FreonFormation(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Plasma,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 40f
                    }
                },

                {
                    Gas.CarbonDioxide,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 20f
                    }
                },

                {
                    Gas.BZ,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 20f
                    }
                }
            },

                minimumTemperature: 37315f,
                maximumTemperature: 10000000000f,
                minimumPressure: 0f,
                maximumPressure: 10000000000f,
                minimumMoles: 0.01f,
                maximumMoles: 10000000000f,
                energyChange: 0f,
                addToBaseReactions: true
                );

            #endregion

            #region WaterVapour

            WaterVapour = new GasReactions(

                reaction: new WaterVapourReaction(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.WaterVapor,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                },
            },

                minimumTemperature: 1f,
                maximumTemperature: AtmosDefines.WATER_VAPOR_FREEZE + 1,
                minimumPressure: 0f,
                maximumPressure: 10000000000f,
                minimumMoles: 0.01f,
                maximumMoles: 10000000000f,
                energyChange: 0f,
                addToBaseReactions: true
                );

            #endregion

            #region Stimulum

            StimulumForm = new GasReactions(

                reaction: new StimulumFormation(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Tritium,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 30f
                    }
                },

                {
                    Gas.Plasma,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 10f
                    }
                },

                {
                    Gas.BZ,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 20f
                    }
                },

                {
                    Gas.Nitryl,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 30f
                    }
                }
            },

                minimumTemperature: AtmosDefines.STIMULUM_HEAT_SCALE / 2,
                maximumTemperature: 10000000000f,
                minimumPressure: 0f,
                maximumPressure: 10000000000f,
                minimumMoles: 0.01f,
                maximumMoles: 10000000000f,
                energyChange: 0f,
                addToBaseReactions: true
                );

            StimBallReaction = new GasReactions(

                reaction: new StimBallReaction(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Pluoxium,
                    new GasReactionData()
                    {
                        minimumMolesToReact = AtmosDefines.STIM_BALL_GAS_AMOUNT
                    }
                },

                {
                    Gas.Stimulum,
                    new GasReactionData()
                    {
                        minimumMolesToReact = AtmosDefines.STIM_BALL_GAS_AMOUNT
                    }
                },

                {
                    Gas.Nitryl,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                },

                {
                    Gas.Plasma,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                }
            },

                minimumTemperature: 373.15f,
                maximumTemperature: 10000000000f,
                minimumPressure: 0f,
                maximumPressure: 10000000000f,
                minimumMoles: 0.01f,
                maximumMoles: 10000000000f,
                energyChange: 0f,
                addToBaseReactions: true
                );

            #endregion

            #region HyperNoblium

            HyperNobliumForm = new GasReactions(

                reaction: new HyperNobliumFormation(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Nitrogen,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 10f
                    }
                },

                {
                    Gas.Tritium,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 5f
                    }
                }
            },

                minimumTemperature: 5000000,
                maximumTemperature: 10000000000f,
                minimumPressure: 0f,
                maximumPressure: 10000000000f,
                minimumMoles: 0.01f,
                maximumMoles: 10000000000f,
                energyChange: 0f,
                addToBaseReactions: true
                );

            #endregion

            #region Miasma

            MiasmaDecomp = new GasReactions(

                reaction: new MiasmaDecomposition(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Miasma,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                }
            },

                minimumTemperature: 443.15f,
                maximumTemperature: 10000000000f,
                minimumPressure: 0f,
                maximumPressure: 10000000000f,
                minimumMoles: 0.01f,
                maximumMoles: 10000000000f,
                energyChange: 0f,
                addToBaseReactions: true
                );

            #endregion
        }
Exemple #6
0
        public static void SetUpReactions()
        {
            gasReactions.Clear();

            #region TritiumFire

            TritiumFire = new GasReactions(

                reaction: new TritiumFireReaction(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Tritium,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                },

                {
                    Gas.Oxygen,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                }
            },

                minimumTileTemperature: AtmosDefines.FIRE_MINIMUM_TEMPERATURE_TO_EXIST,
                maximumTileTemperature: 10000000000,
                minimumTilePressure: 0f,
                maximumTilePressure: 10000000000,

                //Tritium + Oxygen
                minimumTileMoles: 0.02f,
                maximumTileMoles: 10000000000,
                addToBaseReactions: true
                );

            #endregion

            #region PlasmaFire

            PlasmaFire = new GasReactions(

                reaction: new PlasmaFireReaction(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Plasma,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                },

                {
                    Gas.Oxygen,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                }
            },

                minimumTileTemperature: AtmosDefines.FIRE_MINIMUM_TEMPERATURE_TO_EXIST,
                maximumTileTemperature: 10000000000,
                minimumTilePressure: 0,
                maximumTilePressure: 10000000000,

                //Plasma + Oxygen
                minimumTileMoles: 0.02f,
                maximumTileMoles: 10000000000,
                addToBaseReactions: true
                );

            #endregion

            #region FreonFire

            FreonFire = new GasReactions(

                reaction: new FreonFireReaction(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Oxygen,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                },

                {
                    Gas.Freon,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                }
            },

                minimumTileTemperature: 0,
                maximumTileTemperature: 10000000000,
                minimumTilePressure: 0,
                maximumTilePressure: 10000000000,

                //Freon + Oxygen
                minimumTileMoles: 0.02f,
                maximumTileMoles: 10000000000,
                addToBaseReactions: true
                );

            #endregion

            #region Fusion

            Fusion = new GasReactions(

                reaction: new FusionReaction(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Tritium,
                    new GasReactionData()
                    {
                        minimumMolesToReact = AtmosDefines.FUSION_TRITIUM_MOLES_USED
                    }
                },

                {
                    Gas.Plasma,
                    new GasReactionData()
                    {
                        minimumMolesToReact = AtmosDefines.FUSION_MOLE_THRESHOLD
                    }
                },

                {
                    Gas.CarbonDioxide,
                    new GasReactionData()
                    {
                        minimumMolesToReact = AtmosDefines.FUSION_MOLE_THRESHOLD
                    }
                }
            },

                minimumTileTemperature: AtmosDefines.FUSION_TEMPERATURE_THRESHOLD,
                maximumTileTemperature: 10000000000,
                minimumTilePressure: 0,
                maximumTilePressure: 10000000000,
                minimumTileMoles: AtmosDefines.FUSION_TRITIUM_MOLES_USED + (2 * AtmosDefines.FUSION_MOLE_THRESHOLD),
                maximumTileMoles: 10000000000,
                addToBaseReactions: true
                );

            #endregion

            #region NO2

            NO2Form = new GasReactions(

                reaction: new NO2Formation(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Oxygen,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 10
                    }
                },

                {
                    Gas.Nitrogen,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 20
                    }
                },

                {
                    Gas.BZ,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 5
                    }
                }
            },

                minimumTileTemperature: 200,
                maximumTileTemperature: 250,
                minimumTilePressure: 0,
                maximumTilePressure: 10000000000,

                //Oxygen + Nitrogen + BZ
                minimumTileMoles: 35,
                maximumTileMoles: 10000000000,
                addToBaseReactions: true
                );

            NO2Decomp = new GasReactions(

                reaction: new NO2Decomposition(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.NitrousOxide,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                }
            },

                minimumTileTemperature: AtmosDefines.N2O_DECOMPOSITION_MIN_ENERGY,
                maximumTileTemperature: 10000000000,
                minimumTilePressure: 0,
                maximumTilePressure: 10000000000,
                minimumTileMoles: 0.01f,
                maximumTileMoles: 10000000000,
                addToBaseReactions: true
                );

            #endregion

            #region Nitryl

            NitrylForm = new GasReactions(

                reaction: new NitrylFormation(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Oxygen,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 10
                    }
                },

                {
                    Gas.Nitrogen,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 20
                    }
                },

                {
                    Gas.BZ,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 5
                    }
                }
            },

                minimumTileTemperature: 600,
                maximumTileTemperature: 10000000000,
                minimumTilePressure: 0,
                maximumTilePressure: 10000000000,

                //Oxygen + Nitrogen + BZ
                minimumTileMoles: 35,
                maximumTileMoles: 10000000000,
                addToBaseReactions: true
                );

            #endregion

            #region BZ

            BZForm = new GasReactions(

                reaction: new BZFormation(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.NitrousOxide,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 10
                    }
                },

                {
                    Gas.Plasma,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 10
                    }
                }
            },

                minimumTileTemperature: 1,
                maximumTileTemperature: 10000000000,
                minimumTilePressure: 0,
                maximumTilePressure: 10000000000,

                //NO2 + Plasma
                minimumTileMoles: 20,
                maximumTileMoles: 1000000000,
                addToBaseReactions: true
                );

            #endregion

            #region Freon

            FreonForm = new GasReactions(

                reaction: new FreonFormation(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Plasma,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 40
                    }
                },

                {
                    Gas.CarbonDioxide,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 20
                    }
                },

                {
                    Gas.BZ,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 20
                    }
                }
            },

                minimumTileTemperature: AtmosDefines.FIRE_MINIMUM_TEMPERATURE_TO_EXIST + 100,
                maximumTileTemperature: 10000000000,
                minimumTilePressure: 0,
                maximumTilePressure: 10000000000,

                //Plasma + CO2 + BZ
                minimumTileMoles: 80,
                maximumTileMoles: 10000000000,
                addToBaseReactions: true
                );

            #endregion

            #region WaterVapour

            WaterVapour = new GasReactions(

                reaction: new WaterVapourReaction(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.WaterVapor,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                },
            },

                minimumTileTemperature: 1,
                maximumTileTemperature: AtmosDefines.WATER_VAPOR_FREEZE + 1,
                minimumTilePressure: 0,
                maximumTilePressure: 10000000000,
                minimumTileMoles: 0.01f,
                maximumTileMoles: 10000000000,
                addToBaseReactions: true
                );

            #endregion

            #region Stimulum

            StimulumForm = new GasReactions(

                reaction: new StimulumFormation(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Tritium,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 30
                    }
                },

                {
                    Gas.Plasma,
                    new GasReactionData()
                    {
                        minimumMolesToReact = AtmosDefines.MINIMUM_MOLE_COUNT
                    }
                },

                {
                    Gas.BZ,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 20
                    }
                },

                {
                    Gas.Nitryl,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 30
                    }
                }
            },

                minimumTileTemperature: 1500,
                maximumTileTemperature: 10000000000,
                minimumTilePressure: 0,
                maximumTilePressure: 10000000000,

                //Tritium + Plasma + BZ + Nitryl
                minimumTileMoles: 80,
                maximumTileMoles: 10000000000,
                addToBaseReactions: true
                );

            StimBallReaction = new GasReactions(

                reaction: new StimBallReaction(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Pluoxium,
                    new GasReactionData()
                    {
                        minimumMolesToReact = AtmosDefines.STIM_BALL_GAS_AMOUNT
                    }
                },

                {
                    Gas.Stimulum,
                    new GasReactionData()
                    {
                        minimumMolesToReact = AtmosDefines.STIM_BALL_GAS_AMOUNT
                    }
                },

                {
                    Gas.Nitryl,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                },

                {
                    Gas.Plasma,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                }
            },

                minimumTileTemperature: AtmosDefines.FIRE_MINIMUM_TEMPERATURE_TO_EXIST,
                maximumTileTemperature: 10000000000,
                minimumTilePressure: 0,
                maximumTilePressure: 10000000000,

                // Pluoxium + Stimulum + Nitryl + Plasma
                minimumTileMoles: (AtmosDefines.STIM_BALL_GAS_AMOUNT * 2) + 0.02f,
                maximumTileMoles: 10000000000,
                addToBaseReactions: true
                );

            #endregion

            #region HyperNoblium

            HyperNobliumForm = new GasReactions(

                reaction: new HyperNobliumFormation(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Nitrogen,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 10
                    }
                },

                {
                    Gas.Tritium,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 5
                    }
                }
            },

                minimumTileTemperature: AtmosDefines.SPACE_TEMPERATURE,
                maximumTileTemperature: 15,
                minimumTilePressure: 0,
                maximumTilePressure: 10000000000,

                //Nitrogen + Tritium
                minimumTileMoles: 15,
                maximumTileMoles: 10000000000,
                addToBaseReactions: true
                );

            #endregion

            #region Miasma

            MiasmaDecomp = new GasReactions(

                reaction: new MiasmaDecomposition(),

                gasReactionData: new Dictionary <GasSO, GasReactionData>()
            {
                {
                    Gas.Miasma,
                    new GasReactionData()
                    {
                        minimumMolesToReact = 0.01f
                    }
                }
            },

                minimumTileTemperature: AtmosDefines.FIRE_MINIMUM_TEMPERATURE_TO_EXIST + 70,
                maximumTileTemperature: 10000000000,
                minimumTilePressure: 0,
                maximumTilePressure: 10000000000,
                minimumTileMoles: 0.01f,
                maximumTileMoles: 10000000000,
                addToBaseReactions: true
                );

            #endregion
        }