Package controller

Class Controller

java.lang.Object
controller.Controller

public class Controller extends Object
  • Constructor Details

    • Controller

      public Controller(GameModel gameModel)
  • Method Details

    • mouseClickRequest

      public void mouseClickRequest(Coordinate coordinate, ICallBack callBack)
      Handles every mouse click (on grid system) from the user
      Parameters:
      coordinate - the coordinate of the cell the user click in grid sense.
      callBack - will be called after the handle of the request, can be null for defaults.
    • switchGameModeRequest

      public void switchGameModeRequest(GameMode gameMode)
      Handles client request of mode switching (Button click)
      Parameters:
      gameMode - the mode to switch to.
    • switchTimeModeRequest

      public void switchTimeModeRequest(TimeMode timeMode)
      Handles client request of time mode switching (Button click)
      Parameters:
      timeMode - the time mode to switch to
    • regularUpdateRequest

      public void regularUpdateRequest(int dayPass, ICallBack callBack)
      Update the game model regularly with calculated time pass. The actual day pass will be according to the time mode.
      Parameters:
      dayPass - the pass of time in the unit of day.
      callBack - will be called after the handle of the request, can be null for defaults.
    • updateTaxRate

      public void updateTaxRate(double newTaxRate, ICallBack callBack)
      Updates the tax rate.
      Parameters:
      newTaxRate - the new rate.
      callBack - will be called after the handle of the request, can be null for defaults.