public TemperatureExposeEvent(MapIndices indices, GridId gridId, GasMixture air, float temperature, float volume)
 {
     Indices     = indices;
     Grid        = gridId;
     Air         = air;
     Temperature = temperature;
     Volume      = volume;
 }
示例#2
0
 public TileAtmosphere(GridAtmosphereComponent atmosphereComponent, GridId gridIndex, MapIndices gridIndices, GasMixture mixture = null)
 {
     IoCManager.InjectDependencies(this);
     _gridAtmosphereComponent = atmosphereComponent;
     GridIndex   = gridIndex;
     GridIndices = gridIndices;
     Air         = mixture;
 }
 public override void Initialize()
 {
     base.Initialize();
     Air = new GasMixture(_gasVolume)
     {
         Temperature = _gasTemperature
     };
     Air.SetMoles(_gas, _gasAmount);
 }
示例#4
0
        public TileAtmosphere(GridAtmosphereComponent atmosphereComponent, GridId gridIndex, Vector2i gridIndices, GasMixture mixture = null, bool immutable = false)
        {
            IoCManager.InjectDependencies(this);
            _gridAtmosphereComponent = atmosphereComponent;
            _gridTileLookupSystem = _entityManager.EntitySysManager.GetEntitySystem<GridTileLookupSystem>();
            GridIndex = gridIndex;
            GridIndices = gridIndices;
            Air = mixture;

            if(immutable)
                Air?.MarkImmutable();
        }
示例#5
0
        public bool AssumeAir(GasMixture giver)
        {
            if (giver == null || Air == null)
            {
                return(false);
            }

            Air.Merge(giver);

            UpdateVisuals();

            return(true);
        }
        public void SelfBreakdown(bool spaceIsAllConsuming = false)
        {
            var combined = new GasMixture(Atmospherics.CellVolume);

            var tileSize = _tile.Count;

            if (_disposed)
            {
                return;
            }

            if (tileSize == 0)
            {
                Dispose();
                return;
            }

            foreach (var tile in _tile)
            {
                if (tile?.Air == null)
                {
                    continue;
                }
                combined.Merge(tile.Air);
                if (!spaceIsAllConsuming || !tile.Air.Immutable)
                {
                    continue;
                }
                combined.Clear();
                break;
            }

            combined.Multiply(1 / (float)tileSize);

            foreach (var tile in _tile)
            {
                if (tile?.Air == null)
                {
                    continue;
                }
                tile.Air.CopyFromMutable(combined);
                tile.AtmosCooldown = 0;
                tile.UpdateVisuals();
            }

            BreakdownCooldown = 0;
        }
示例#7
0
 public void TemperatureExpose(GasMixture mixture, float temperature, float cellVolume)
 {
     // TODO ATMOS do this
 }