コード例 #1
0
        public FieldPlayer(int number, player_role role, State <FieldPlayer> startState, Team team) : base(number, role, team)
        {
            stateMachine = new StateMachine <FieldPlayer>(this);

            if (startState != null)
            {
                stateMachine.SetCurrentState(startState);
                stateMachine.SetPreviousState(startState);
                stateMachine.SetGlobalState(GlobalState.instance);
            }
        }
コード例 #2
0
        public Player(int number, player_role role, Team team) : base(BaseGameEntity.GetNextValidID())
        {
            //varibale initialization
            position = new Position();

            this.team = team;

            playerNumber = number;
            //player number is the id of the player
            id = playerNumber;

            this.role = role;
        }
コード例 #3
0
        public GoalKeeper(int number, player_role role, State <GoalKeeper> startState, Team team)
            : base(number, role, team)
        {
            returnPosition = new Position();
            stateMachine   = new StateMachine <GoalKeeper>(this);

            if (startState != null)
            {
                stateMachine.SetCurrentState(startState);
                stateMachine.SetPreviousState(startState);
                stateMachine.SetGlobalState(GlobalKeeperState.instance);
            }
        }