示例#1
0
        public AtmosphereManager Clone()
        {
            var a = new AtmosphereManager(this._room);

            a._atmosphericGasses = new Dictionary <string, float>(this._atmosphericGasses);
            return(a);
        }
示例#2
0
        public void EqualiseAtmosphere(AtmosphereManager other, float qty)
        {
            // This is a list of all the gasses involved in each room
            var gasses = this.GetGasNames().Union(other.GetGasNames()).ToList();

            foreach (var gas in gasses)
            {
                var thisAmt  = this.GetGasAmount(gas);
                var otherAmt = other.GetGasAmount(gas);
                var diffAmt  = thisAmt - otherAmt;
                var transAmt = diffAmt / 2;

                //if (diffAmt > 0)
                //{
                // +ve means pumping this gas from This to Other, -ve means other-to-this.
                this.ChangeGas(gas, -transAmt, false);
                other.ChangeGas(gas, transAmt, false);
                //}

                //if (diffAmt < 0)
                //{
                //    // Pumping from Other to This.
                //    this.ChangeGas(gas, transAmt);
                //    other.ChangeGas(gas, -transAmt);
                //}
            }
        }
示例#3
0
 public Room()
 {
     _tiles     = new List <Tile>();
     Atmosphere = new AtmosphereManager(this);
 }
示例#4
0
 public void CopyGas(AtmosphereManager atmosphere)
 {
     this._atmosphericGasses = new Dictionary <string, float>(atmosphere._atmosphericGasses);
 }