Esempio n. 1
0
        public void Update()
        {
            if (attachedTile.GasSink)
            {
                gasMixture.SetNextTemperature(0);
                for (var i = 0; i < gasMixture.gasses.Length; i++)
                {
                    gasMixture.nextGasses[i] = 0;
                }
            }

            gasVel     = NextGasVel;
            NextGasVel = new Vector2(0, 0);

            gasMixture.Burn();

            // Copy next gas values into gas values
            gasMixture.Update();

            calculated = false;
        }
Esempio n. 2
0
        public void ShareTemp(GasMixture a, float factor = 8)
        {
            float HCCell     = HeatCapacity * TotalMass;
            float HCa        = a.HeatCapacity * a.TotalMass;
            float energyFlow = a.Temperature - Temperature;

            if (energyFlow > 0.0f)
            {
                energyFlow *= HCa;
            }
            else
            {
                energyFlow *= HCCell;
            }

            energyFlow *= (1 / factor);
            SetNextTemperature((energyFlow / HCCell));
            a.SetNextTemperature(-(energyFlow / HCa));
        }
Esempio n. 3
0
        public void ShareTemp(GasMixture a, float factor = 8)
        {
            float HCCell = HeatCapacity*TotalMass;
            float HCa = a.HeatCapacity*a.TotalMass;
            float energyFlow = a.Temperature - Temperature;

            if (energyFlow > 0.0f)
            {
                energyFlow *= HCa;
            }
            else
            {
                energyFlow *= HCCell;
            }

            energyFlow *= (1/factor);
            SetNextTemperature((energyFlow/HCCell));
            a.SetNextTemperature(-(energyFlow/HCa));
        }