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); } }
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; }
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); } }