コード例 #1
0
        /// <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);
        }
コード例 #2
0
 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));
 }
コード例 #3
0
        /// <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>();
        }
コード例 #4
0
        /// <inheritdoc />
        public override void Initialize()
        {
            SubscribeLocalEvent <EntRemovedFromContainerMessage>(HandleEntityRemovedFromContainer);
            SubscribeLocalEvent <EntInsertedIntoContainerMessage>(HandleEntityInsertedIntoContainer);

            EntityQuery = new TypeEntityQuery(typeof(ServerStorageComponent));
        }
コード例 #5
0
        public override void Initialize()
        {
            base.Initialize();

            EntityQuery = new TypeEntityQuery(typeof(RadioComponent));
            _messages   = new List <string>();
        }
コード例 #6
0
        public override void Initialize()
        {
            base.Initialize();
            EntityQuery = new TypeEntityQuery(typeof(PuddleComponent));
            var mapManager = IoCManager.Resolve <IMapManager>();

            mapManager.TileChanged += HandleTileChanged;
        }
コード例 #7
0
        public override void Initialize()
        {
            base.Initialize();

            EntityQuery = new TypeEntityQuery(typeof(BuckleComponent));

            UpdatesAfter.Add(typeof(InteractionSystem));
            UpdatesAfter.Add(typeof(InputSystem));
        }
コード例 #8
0
        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>();
        }
コード例 #9
0
        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());
        }
コード例 #10
0
        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));
        }
コード例 #11
0
ファイル: AiSystem.cs プロジェクト: WhaleKit/space-station-14
        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);
                }
            }
        }
コード例 #12
0
        /// <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);
            }
        }
コード例 #13
0
        /// <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);
                }
            }
        }
コード例 #14
0
        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);
        }
コード例 #15
0
ファイル: MoverSystem.cs プロジェクト: zamp/space-station-14
        /// <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);
        }
コード例 #16
0
 /// <inheritdoc />
 public override void Initialize()
 {
     EntityQuery = new TypeEntityQuery(typeof(ServerUserInterfaceComponent));
 }
コード例 #17
0
 public override void Initialize()
 {
     base.Initialize();
     EntityQuery = new TypeEntityQuery(typeof(InstrumentComponent));
 }
コード例 #18
0
#pragma warning restore 649

        public override void Initialize()
        {
            EntityQuery = new TypeEntityQuery(typeof(ApcComponent));
        }
コード例 #19
0
 public override void Initialize()
 {
     EntityQuery = new TypeEntityQuery(typeof(HandheldLightComponent));
 }
コード例 #20
0
 public PowerSystem()
 {
     EntityQuery = new TypeEntityQuery(typeof(PowerDeviceComponent));
 }
コード例 #21
0
 /// <inheritdoc />
 public override void Initialize()
 {
     EntityQuery = new TypeEntityQuery(typeof(ServerStorageComponent));
 }
コード例 #22
0
        public override void Initialize()
        {
            base.Initialize();

            EntityQuery = new TypeEntityQuery(typeof(StunnableComponent));
        }
コード例 #23
0
 public override void Initialize()
 {
     base.Initialize();
     _speciesQuery = new TypeEntityQuery(typeof(ISharedBodyManagerComponent));
 }
コード例 #24
0
 public PhysicsSystem()
 {
     EntityQuery = new TypeEntityQuery(typeof(PhysicsComponent));
 }
コード例 #25
0
 public override void Initialize()
 {
     EntityQuery = new TypeEntityQuery(typeof(PowerCellChargerComponent));
 }
コード例 #26
0
        public override void Initialize()
        {
            base.Initialize();

            EntityQuery = new TypeEntityQuery <PhysicsComponent>();
        }
コード例 #27
0
 public SpriteSystem()
 {
     EntityQuery = new TypeEntityQuery(typeof(ISpriteComponent));
 }
コード例 #28
0
#pragma warning restore 649

        public override void Initialize()
        {
            SubscribeNetworkEvent <PlayMeleeWeaponAnimationMessage>(PlayWeaponArc);
            EntityQuery = new TypeEntityQuery(typeof(MeleeWeaponArcAnimationComponent));
        }
コード例 #29
0
#pragma warning restore 649

        public override void Initialize()
        {
            base.Initialize();

            EntityQuery = new TypeEntityQuery(typeof(MeleeWeaponArcAnimationComponent));
        }
コード例 #30
0
 public override void Initialize()
 {
     base.Initialize();
     EntityQuery = new TypeEntityQuery(typeof(MicrowaveComponent));
 }