/// <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 override void Initialize() { EntityQuery = new TypeEntityQuery(typeof(SolarPanelComponent)); // Initialize the sun to something random TowardsSun = MathHelper.TwoPi * _robustRandom.NextDouble(); SunAngularVelocity = Angle.FromDegrees(0.1 + ((_robustRandom.NextDouble() - 0.5) * 0.05)); }
/// <inheritdoc /> public override void Initialize() { EntityQuery = new TypeEntityQuery(typeof(IMoverComponent)); 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); SubscribeEvent <PlayerAttachSystemMessage>(PlayerAttached); SubscribeEvent <PlayerDetachedSystemMessage>(PlayerDetached); _audioSystem = EntitySystemManager.GetEntitySystem <AudioSystem>(); }
/// <inheritdoc /> public override void Initialize() { SubscribeLocalEvent <EntRemovedFromContainerMessage>(HandleEntityRemovedFromContainer); SubscribeLocalEvent <EntInsertedIntoContainerMessage>(HandleEntityInsertedIntoContainer); EntityQuery = new TypeEntityQuery(typeof(ServerStorageComponent)); }
public override void Initialize() { base.Initialize(); EntityQuery = new TypeEntityQuery(typeof(RadioComponent)); _messages = new List <string>(); }
public override void Initialize() { base.Initialize(); EntityQuery = new TypeEntityQuery(typeof(PuddleComponent)); var mapManager = IoCManager.Resolve <IMapManager>(); mapManager.TileChanged += HandleTileChanged; }
public override void Initialize() { base.Initialize(); EntityQuery = new TypeEntityQuery(typeof(BuckleComponent)); UpdatesAfter.Add(typeof(InteractionSystem)); UpdatesAfter.Add(typeof(InputSystem)); }
public override void Initialize() { base.Initialize(); EntityQuery = new TypeEntityQuery(typeof(EyeComponent)); //WARN: Tightly couples this system with InputSystem, and assumes InputSystem exists and is initialized CommandBinds.Builder .Bind(EngineKeyFunctions.CameraRotateRight, new NullInputCmdHandler()) .Bind(EngineKeyFunctions.CameraRotateLeft, new NullInputCmdHandler()) .Register <EyeUpdateSystem>(); }
public override void Initialize() { base.Initialize(); EntityQuery = new TypeEntityQuery(typeof(EyeComponent)); //WARN: Tightly couples this system with InputSystem, and assumes InputSystem exists and is initialized var inputSystem = EntitySystemManager.GetEntitySystem <InputSystem>(); inputSystem.BindMap.BindFunction(EngineKeyFunctions.CameraRotateRight, new NullInputCmdHandler()); inputSystem.BindMap.BindFunction(EngineKeyFunctions.CameraRotateLeft, new NullInputCmdHandler()); }
public override void Initialize() { base.Initialize(); EntityQuery = new TypeEntityQuery(typeof(EyeComponent)); //WARN: Tightly couples this system with InputSystem, and assumes InputSystem exists and is initialized CommandBinds.Builder .Bind(EngineKeyFunctions.CameraRotateRight, new NullInputCmdHandler()) .Bind(EngineKeyFunctions.CameraRotateLeft, new NullInputCmdHandler()) .Register <EyeUpdateSystem>(); // Make sure this runs *after* entities have been moved by interpolation and movement. UpdatesAfter.Add(typeof(TransformSystem)); UpdatesAfter.Add(typeof(PhysicsSystem)); }
public AiSystem() { // register entity query EntityQuery = new TypeEntityQuery(typeof(AiControllerComponent)); 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); } } }
/// <inheritdoc /> public override void Initialize() { base.Initialize(); // register entity query EntityQuery = new TypeEntityQuery(typeof(AiControllerComponent)); var processors = _reflectionManager.GetAllChildren <AiLogicProcessor>(); foreach (var processor in processors) { var att = (AiLogicProcessorAttribute)Attribute.GetCustomAttribute(processor, typeof(AiLogicProcessorAttribute)); // Tests should pick this up DebugTools.AssertNotNull(att); _processorTypes.Add(att.SerializeName, processor); } }
/// <inheritdoc /> public override void Initialize() { base.Initialize(); // register entity query EntityQuery = new TypeEntityQuery(typeof(AiControllerComponent)); var processors = _reflectionManager.GetAllChildren <AiLogicProcessor>(); foreach (var processor in processors) { var att = (AiLogicProcessorAttribute)Attribute.GetCustomAttribute(processor, typeof(AiLogicProcessorAttribute)); if (att != null) { _processorTypes.Add(att.SerializeName, processor); } } }
public override void Initialize() { base.Initialize(); EntityQuery = new TypeEntityQuery(typeof(IMoverComponent)); var moveUpCmdHandler = new MoverDirInputCmdHandler(Direction.North); var moveLeftCmdHandler = new MoverDirInputCmdHandler(Direction.West); var moveRightCmdHandler = new MoverDirInputCmdHandler(Direction.East); var moveDownCmdHandler = new MoverDirInputCmdHandler(Direction.South); CommandBinds.Builder .Bind(EngineKeyFunctions.MoveUp, moveUpCmdHandler) .Bind(EngineKeyFunctions.MoveLeft, moveLeftCmdHandler) .Bind(EngineKeyFunctions.MoveRight, moveRightCmdHandler) .Bind(EngineKeyFunctions.MoveDown, moveDownCmdHandler) .Bind(EngineKeyFunctions.Walk, new WalkInputCmdHandler()) .Register <SharedMoverSystem>(); _configurationManager.RegisterCVar("game.diagonalmovement", true, CVar.ARCHIVE); }
/// <inheritdoc /> public override void Initialize() { EntityQuery = new TypeEntityQuery(typeof(IMoverComponent)); 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 walkCmdHandler = InputCmdHandler.FromDelegate( session => HandleRunChange(session, true), session => HandleRunChange(session, false)); var input = EntitySystemManager.GetEntitySystem <InputSystem>(); CommandBinds.Builder .Bind(EngineKeyFunctions.MoveUp, moveUpCmdHandler) .Bind(EngineKeyFunctions.MoveLeft, moveLeftCmdHandler) .Bind(EngineKeyFunctions.MoveRight, moveRightCmdHandler) .Bind(EngineKeyFunctions.MoveDown, moveDownCmdHandler) .Bind(EngineKeyFunctions.Walk, walkCmdHandler) .Register <MoverSystem>(); SubscribeLocalEvent <PlayerAttachSystemMessage>(PlayerAttached); SubscribeLocalEvent <PlayerDetachedSystemMessage>(PlayerDetached); _audioSystem = EntitySystemManager.GetEntitySystem <AudioSystem>(); _configurationManager.RegisterCVar("game.diagonalmovement", true, CVar.ARCHIVE); }
/// <inheritdoc /> public override void Initialize() { EntityQuery = new TypeEntityQuery(typeof(ServerUserInterfaceComponent)); }
public override void Initialize() { base.Initialize(); EntityQuery = new TypeEntityQuery(typeof(InstrumentComponent)); }
#pragma warning restore 649 public override void Initialize() { EntityQuery = new TypeEntityQuery(typeof(ApcComponent)); }
public override void Initialize() { EntityQuery = new TypeEntityQuery(typeof(HandheldLightComponent)); }
public PowerSystem() { EntityQuery = new TypeEntityQuery(typeof(PowerDeviceComponent)); }
/// <inheritdoc /> public override void Initialize() { EntityQuery = new TypeEntityQuery(typeof(ServerStorageComponent)); }
public override void Initialize() { base.Initialize(); EntityQuery = new TypeEntityQuery(typeof(StunnableComponent)); }
public override void Initialize() { base.Initialize(); _speciesQuery = new TypeEntityQuery(typeof(ISharedBodyManagerComponent)); }
public PhysicsSystem() { EntityQuery = new TypeEntityQuery(typeof(PhysicsComponent)); }
public override void Initialize() { EntityQuery = new TypeEntityQuery(typeof(PowerCellChargerComponent)); }
public override void Initialize() { base.Initialize(); EntityQuery = new TypeEntityQuery <PhysicsComponent>(); }
public SpriteSystem() { EntityQuery = new TypeEntityQuery(typeof(ISpriteComponent)); }
#pragma warning restore 649 public override void Initialize() { SubscribeNetworkEvent <PlayMeleeWeaponAnimationMessage>(PlayWeaponArc); EntityQuery = new TypeEntityQuery(typeof(MeleeWeaponArcAnimationComponent)); }
#pragma warning restore 649 public override void Initialize() { base.Initialize(); EntityQuery = new TypeEntityQuery(typeof(MeleeWeaponArcAnimationComponent)); }
public override void Initialize() { base.Initialize(); EntityQuery = new TypeEntityQuery(typeof(MicrowaveComponent)); }