Coverage Summary for Class: GamePhase (it.polimi.ingsw.model)

Class Class, % Method, % Line, %
GamePhase 100% (1/ 1) 100% (5/ 5) 100% (5/ 5)


1 package it.polimi.ingsw.model; 2  3 public enum GamePhase { 4  /** 5  * Different game phases 6  */ 7  SET_GOD_LIST, CHOOSE_GOD, START_PLAYER, SET_COLOR, SET_WORKERS, CHOOSE_WORKER, PENDING, CHOOSE_ACTION, END; 8  9  /** 10  * Gives the next GamePhase 11  * @return next GamePhase 12  */ 13  public GamePhase next() { 14  return GamePhase.values()[Math.min(this.ordinal() + 1, GamePhase.values().length - 1)]; 15  } 16  17  /** 18  * Gives the previous GamePhase 19  * @return previous GamePhase 20  */ 21  public GamePhase prev() { 22  return GamePhase.values()[Math.max(this.ordinal() - 1, 0)]; 23  } 24  25  /** 26  * Used only to start the game 27  * @return GamePhase as SET_GOD_LIST 28  */ 29  public static GamePhase start() { 30  return GamePhase.SET_GOD_LIST; 31  } 32 }