/// <inheritdoc /> public override void Initialize() { _pauseManager = IoCManager.Resolve <IPauseManager>(); EntityQuery = new TypeEntityQuery(typeof(PlayerInputMoverComponent)); var moveUpCmdHandler = InputCmdHandler.FromDelegate( session => HandleDirChange(session, Direction.North, true), session => HandleDirChange(session, Direction.North, false)); var moveLeftCmdHandler = InputCmdHandler.FromDelegate( session => HandleDirChange(session, Direction.West, true), session => HandleDirChange(session, Direction.West, false)); var moveRightCmdHandler = InputCmdHandler.FromDelegate( session => HandleDirChange(session, Direction.East, true), session => HandleDirChange(session, Direction.East, false)); var moveDownCmdHandler = InputCmdHandler.FromDelegate( session => HandleDirChange(session, Direction.South, true), session => HandleDirChange(session, Direction.South, false)); var runCmdHandler = InputCmdHandler.FromDelegate( session => HandleRunChange(session, true), session => HandleRunChange(session, false)); var input = EntitySystemManager.GetEntitySystem <InputSystem>(); input.BindMap.BindFunction(EngineKeyFunctions.MoveUp, moveUpCmdHandler); input.BindMap.BindFunction(EngineKeyFunctions.MoveLeft, moveLeftCmdHandler); input.BindMap.BindFunction(EngineKeyFunctions.MoveRight, moveRightCmdHandler); input.BindMap.BindFunction(EngineKeyFunctions.MoveDown, moveDownCmdHandler); input.BindMap.BindFunction(EngineKeyFunctions.Run, runCmdHandler); }
public MapContext(IMapManager maps, ITileDefinitionManager tileDefs, IServerEntityManagerInternal entities, IPauseManager pauseManager) { _mapManager = maps; _tileDefinitionManager = tileDefs; _serverEntityManager = entities; _pauseManager = pauseManager; RootNode = new YamlMappingNode(); }
public MapContext(IMapManager maps, ITileDefinitionManager tileDefs, IServerEntityManagerInternal entities, IPauseManager pauseManager, YamlMappingNode node, IMap targetMap) { _mapManager = maps; _tileDefinitionManager = tileDefs; _serverEntityManager = entities; _pauseManager = pauseManager; RootNode = node; TargetMap = targetMap; }
public MapContext(IMapManagerInternal maps, ITileDefinitionManager tileDefs, IServerEntityManagerInternal entities, IPauseManager pauseManager, IComponentFactory componentFactory, IComponentManager componentManager) { _mapManager = maps; _tileDefinitionManager = tileDefs; _serverEntityManager = entities; _pauseManager = pauseManager; _componentFactory = componentFactory; _componentManager = componentManager; RootNode = new YamlMappingNode(); }
public MapContext(IMapManagerInternal maps, ITileDefinitionManager tileDefs, IServerEntityManagerInternal entities, IPauseManager pauseManager, IComponentManager componentManager, IPrototypeManager prototypeManager, YamlMappingNode node, MapId targetMapId) { _mapManager = maps; _tileDefinitionManager = tileDefs; _serverEntityManager = entities; _pauseManager = pauseManager; _componentManager = componentManager; RootNode = node; TargetMap = targetMapId; _prototypeManager = prototypeManager; }
public AiSystem() { // register entity query EntityQuery = new TypeEntityQuery(typeof(AiControllerComponent)); _pauseManager = IoCManager.Resolve <IPauseManager>(); var reflectionMan = IoCManager.Resolve <IReflectionManager>(); var processors = reflectionMan.GetAllChildren <AiLogicProcessor>(); foreach (var processor in processors) { var att = (AiLogicProcessorAttribute)Attribute.GetCustomAttribute(processor, typeof(AiLogicProcessorAttribute)); if (att != null) { _processorTypes.Add(att.SerializeName, processor); } } }
public static bool IsEntityPaused(this IPauseManager manager, IEntity entity) { return(!entity.HasComponent <IgnorePauseComponent>() && manager.IsGridPaused(entity.Transform.GridID)); }
public static bool IsEntityPaused(this IPauseManager manager, IEntity entity) { return(entity.Paused); }
public override void Initialize() { base.Initialize(); _pauseManager = IoCManager.Resolve <IPauseManager>(); }