Example #1
0
        public override void Initialize()
        {
            base.Initialize();

            _gasReactions = _protoMan.EnumeratePrototypes <GasReactionPrototype>().ToArray();
            Array.Sort(_gasReactions, (a, b) => b.Priority.CompareTo(a.Priority));

            _spaceAtmos = new SpaceGridAtmosphereComponent();
            _spaceAtmos.Initialize();
            IoCManager.InjectDependencies(_spaceAtmos);

            _mapManager.TileChanged += OnTileChanged;

            Array.Resize(ref _gasSpecificHeats, MathHelper.NextMultipleOf(Atmospherics.TotalNumberOfGases, 4));

            for (var i = 0; i < GasPrototypes.Length; i++)
            {
                _gasSpecificHeats[i] = GasPrototypes[i].SpecificHeat;
            }

            // Required for airtight components.
            EntityManager.EventBus.SubscribeEvent <RotateEvent>(EventSource.Local, this, RotateEvent);

            _cfg.OnValueChanged(CCVars.SpaceWind, OnSpaceWindChanged, true);
            _cfg.OnValueChanged(CCVars.MonstermosEqualization, OnMonstermosEqualizationChanged, true);
            _cfg.OnValueChanged(CCVars.AtmosMaxProcessTime, OnAtmosMaxProcessTimeChanged, true);
            _cfg.OnValueChanged(CCVars.AtmosTickRate, OnAtmosTickRateChanged, true);
            _cfg.OnValueChanged(CCVars.ExcitedGroupsSpaceIsAllConsuming, OnExcitedGroupsSpaceIsAllConsumingChanged, true);
        }
        public override void Initialize()
        {
            base.Initialize();

            _gasReactions = _protoMan.EnumeratePrototypes <GasReactionPrototype>().ToArray();
            Array.Sort(_gasReactions, (a, b) => b.Priority.CompareTo(a.Priority));

            _spaceAtmos = new SpaceGridAtmosphereComponent();
            _spaceAtmos.Initialize();
            IoCManager.InjectDependencies(_spaceAtmos);

            _mapManager.TileChanged += OnTileChanged;
        }
        public override void Initialize()
        {
            base.Initialize();

            _gasReactions = _protoMan.EnumeratePrototypes <GasReactionPrototype>().ToArray();
            Array.Sort(_gasReactions, (a, b) => b.Priority.CompareTo(a.Priority));

            _spaceAtmos = new SpaceGridAtmosphereComponent();
            _spaceAtmos.Initialize();
            IoCManager.InjectDependencies(_spaceAtmos);

            _mapManager.TileChanged += OnTileChanged;

            // Required for airtight components.
            EntityManager.EventBus.SubscribeEvent <RotateEvent>(EventSource.Local, this, RotateEvent);
        }