コード例 #1
0
ファイル: GasCell.cs プロジェクト: stupid-genius/ss13remake
 public GasCell(Tile _attachedTile)
 {
     gasVel         = new Vector2(0, 0);
     NextGasVel     = new Vector2(0, 0);
     lastSentGasses = new Dictionary <GasType, float>();
     gasMixture     = new GasMixture();
     rand           = new Random();
     attachedTile   = _attachedTile;
 }
コード例 #2
0
ファイル: GasCell.cs プロジェクト: Gartley/ss13remake
 public GasCell(Tile _attachedTile)
 {
     gasVel = new Vector2(0, 0);
     NextGasVel = new Vector2(0, 0);
     lastSentGasses = new Dictionary<GasType, float>();
     gasMixture = new GasMixture();
     rand = new Random();
     attachedTile = _attachedTile;
 }
コード例 #3
0
        public void Diffuse(GasMixture a, float factor = 8)
        {
            for (var i = 0; i < a.gasses.Length; i++)
            {
                float amount = (a.gasses[i] - gasses[i]) / factor;
                AddNextGas(amount, (GasType)i);
                a.AddNextGas(-amount, (GasType)i);
            }

            ShareTemp(a, factor);
        }
コード例 #4
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));
        }
コード例 #5
0
ファイル: GasMixture.cs プロジェクト: Gartley/ss13remake
        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));
        }
コード例 #6
0
ファイル: GasMixture.cs プロジェクト: Gartley/ss13remake
        public void Diffuse(GasMixture a, float factor = 8)
        {
            for (var i = 0; i < a.gasses.Length; i++)
            {
                float amount = (a.gasses[i] - gasses[i])/factor;
                AddNextGas(amount, (GasType)i);
                a.AddNextGas(-amount, (GasType)i);
            }

            ShareTemp(a, factor);
        }