/// <summary> /// Executes the the act() function of the state Move /// </summary> private void HandleState() { switch (playerState) { case State.IDLE: idleMove.Act(this); break; case State.RUN: runMove.Act(this); break; case State.WALLRUN_LEFT: wallRunMoveLeft.Act(this); break; case State.WALLRUN_RIGHT: wallrunMoveRight.Act(this); break; case State.CLIMB: ClimbMove.Act(this); break; case State.SLIDE: SlideMove.Act(this); break; case State.AIRBORNE: airborneMove.Act(this); break; } }
public void Act(GameBoard.GameBoard gameBoard) { if (!IsAlive) { return; } IAction action = new Attack(); if (!action.Act(this, gameBoard)) { ChangeDirection(); action = new Move(Direction); action.Act(this, gameBoard); } }