public override void Update(float frameTime)
        {
            base.Update(frameTime);

            _exposedTimer += frameTime;

            foreach (var(mapGridComponent, gridAtmosphereComponent) in EntityManager.ComponentManager.EntityQuery <IMapGridComponent, IGridAtmosphereComponent>(true))
            {
                if (_pauseManager.IsGridPaused(mapGridComponent.GridIndex))
                {
                    continue;
                }

                gridAtmosphereComponent.Update(frameTime);
            }

            if (_exposedTimer >= ExposedUpdateDelay)
            {
                foreach (var exposed in EntityManager.ComponentManager.EntityQuery <AtmosExposedComponent>(true))
                {
                    var tile = exposed.Owner.Transform.Coordinates.GetTileAtmosphere();
                    if (tile == null)
                    {
                        continue;
                    }
                    exposed.Update(tile, _exposedTimer);
                }

                _exposedTimer = 0;
            }
        }
        public override void Update(float frameTime)
        {
            base.Update(frameTime);

            foreach (var(mapGridComponent, gridAtmosphereComponent) in EntityManager.ComponentManager.EntityQuery <IMapGridComponent, IGridAtmosphereComponent>())
            {
                if (_pauseManager.IsGridPaused(mapGridComponent.GridIndex))
                {
                    continue;
                }

                gridAtmosphereComponent.Update(frameTime);
            }
        }
예제 #3
0
        public override void Update(float frameTime)
        {
            base.Update(frameTime);

            foreach (var comp in ComponentManager.EntityQuery <DoAfterComponent>())
            {
                if (_pauseManager.IsGridPaused(comp.Owner.Transform.GridID))
                {
                    continue;
                }

                var cancelled = new List <DoAfter>(0);
                var finished  = new List <DoAfter>(0);

                foreach (var doAfter in comp.DoAfters)
                {
                    doAfter.Run(frameTime);

                    switch (doAfter.Status)
                    {
                    case DoAfterStatus.Running:
                        break;

                    case DoAfterStatus.Cancelled:
                        cancelled.Add(doAfter);
                        break;

                    case DoAfterStatus.Finished:
                        finished.Add(doAfter);
                        break;

                    default:
                        throw new ArgumentOutOfRangeException();
                    }
                }

                foreach (var doAfter in cancelled)
                {
                    comp.Cancelled(doAfter);
                }

                foreach (var doAfter in finished)
                {
                    comp.Finished(doAfter);
                }

                finished.Clear();
            }
        }
예제 #4
0
        public override void Update(float frameTime)
        {
            base.Update(frameTime);

            foreach (var gridEnt in RelevantEntities)
            {
                var grid = gridEnt.GetComponent <IMapGridComponent>();
                if (_pauseManager.IsGridPaused(grid.GridIndex))
                {
                    continue;
                }

                gridEnt.GetComponent <GridAtmosphereComponent>().Update(frameTime);
            }
        }
예제 #5
0
 public static bool IsEntityPaused(this IPauseManager manager, IEntity entity)
 {
     return(!entity.HasComponent <IgnorePauseComponent>() && manager.IsGridPaused(entity.Transform.GridID));
 }