Example #1
0
        public StateIdle(StateController stateController) : base(stateController)
        {
            //StateController = stateController;

            CommandsInState.Add(StateController.StateComandManager.AllCommands.Find(h => h is CommandMove));
            CommandsInState.Add(StateController.StateComandManager.AllCommands.Find(h => h is ComandAim));
            CommandsInState.Add(StateController.StateComandManager.AllCommands.Find(h => h is ComandSelectWeapon));
            CommandsInState.Add(StateController.StateComandManager.AllCommands.Find(h => h is ComandRotate));
            CommandsInState.Add(StateController.StateComandManager.AllCommands.Find(h => h is ComandFall));
            CommandsInState.Add(StateController.StateComandManager.AllCommands.Find(h => h is ComandInShotted));

            /*CommandsInState.Add(new CommandMove(true));
             * CommandsInState.Add(new ComandAim());
             * CommandsInState.Add(new ComandSelectWeapon());
             * CommandsInState.Add(new ComandRotate(true));
             * CommandsInState.Add(new ComandFall());
             *
             * CommandsInState[0].StateController = StateController;
             * CommandsInState[1].StateController = StateController;
             * CommandsInState[2].StateController = StateController;
             * CommandsInState[3].StateController = StateController;
             * CommandsInState[4].StateController = StateController;*/

            FillCommandsNotInState();

            StateFlags.CanMove  = true;
            StateFlags.IsMoving = false;
            StateFlags.IsAiming = false;
        }
        public StateAimWalking(StateController stateController) : base(stateController)
        {
            //StateController = stateController;

            CommandsInState.Add(StateController.StateComandManager.AllCommands.Find(h => h is CommandMove));
            CommandsInState.Add(StateController.StateComandManager.AllCommands.Find(h => h is ComandAttack));
            CommandsInState.Add(StateController.StateComandManager.AllCommands.Find(h => h is ComandRun));

            CommandsInState.Add(StateController.StateComandManager.AllCommands.Find(h => h is ComandInShotted));

            /*CommandsInState.Add(new CommandMove(true));
             * CommandsInState.Add(new ComandAttack());
             *
             * CommandsInState[0].StateController = StateController;
             * CommandsInState[1].StateController = stateController;*/
            FillCommandsNotInState();
            StateFlags.CanMove  = true;
            StateFlags.IsMoving = true;
            StateFlags.IsAiming = true;
        }