java.lang.Object
org.bitsquad.warzone.gameengine.phase.Phase
Direct Known Subclasses:
GameFinished, IssueOrderPostDeploy, IssueOrderPreDeploy, OrderExecution, StartupMapEditing

public abstract class Phase extends Object
Phase interface. Represents the state in State Pattern
  • Constructor Details

    • Phase

      protected Phase(GameEngine p_gameEngine)
      Parameterized Constructor
      Parameters:
      p_gameEngine - GameEngine
  • Method Details

    • handleLoadMap

      public abstract void handleLoadMap(String p_filename) throws Exception
      Handler for loadmap command
      Parameters:
      p_filename - String filename
      Throws:
      Exception
    • handleEditMap

      public abstract void handleEditMap(String p_filename) throws IOException
      Handler for editmap command
      Parameters:
      p_filename - String filename
      Throws:
      IOException
    • handleSaveMap

      public abstract void handleSaveMap(String p_filename, boolean p_saveAsConquestMap) throws Exception
      Handler for savemap command
      Parameters:
      p_filename - String filename
      Throws:
      Exception
    • handleValidateMap

      public abstract void handleValidateMap()
      Handler for validatemap command
    • handleEditContinent

      public abstract void handleEditContinent(int[] p_addArray, int[] p_removeIds)
      Handler for editcontinent command
      Parameters:
      p_addArray - ids and values to add
      p_removeIds - ids to remove
    • handleEditCountry

      public abstract void handleEditCountry(int[] p_addIds, int[] p_removeIds)
      Handler method for editcountry command
      Parameters:
      p_addIds - ids to add
      p_removeIds - ids to remove
    • handleEditNeighbor

      public abstract void handleEditNeighbor(int[] p_addIds, int[] p_removeIds)
      Handler method for editneighbor command
      Parameters:
      p_addIds -
      p_removeIds -
    • handleGamePlayer

      public abstract void handleGamePlayer(String[] p_addNames, String[] p_removeNames)
      Handler method for gameplayer command
      Parameters:
      p_addNames - names to add
      p_removeNames - names to remove
    • handleAssignCountries

      public abstract void handleAssignCountries() throws Exception
      Handler method for assigncountries command
      Throws:
      Exception
    • handleDeployArmy

      public abstract void handleDeployArmy(int p_targetCountryId, int p_armyUnits) throws Exception
      Handler method for deploy command
      Parameters:
      p_targetCountryId - Target Country ID
      p_armyUnits - Number of army units
      Throws:
      Exception
    • handleAdvance

      public abstract void handleAdvance(String p_countryNameFrom, String p_targetCountryName, int p_armyUnits) throws Exception
      Handler method for advance command
      Parameters:
      p_countryNameFrom - Source Country Name
      p_targetCountryName - Target Country Name
      p_armyUnits - Number of army units
      Throws:
      Exception
    • handleBomb

      public abstract void handleBomb(int p_countryId) throws Exception
      Handler method for bomb command
      Parameters:
      p_countryId - Country ID
      Throws:
      Exception
    • handleBlockade

      public abstract void handleBlockade(int p_targetCountryId) throws Exception
      Handler method for blockade command
      Parameters:
      p_targetCountryId - target Country ID
      Throws:
      Exception
    • handleAirlift

      public abstract void handleAirlift(int p_sourceCountryId, int p_targetCountryId, int p_numArmies) throws Exception
      Handler method for airlift command
      Parameters:
      p_sourceCountryId -
      p_targetCountryId -
      p_numArmies -
      Throws:
      Exception
    • handleNegotiate

      public abstract void handleNegotiate(int p_targetPlayerId) throws Exception
      Handler method for negotiate command
      Parameters:
      p_targetPlayerId - Target Player ID
      Throws:
      Exception
    • handleCommit

      public abstract void handleCommit()
      Handler method for commit command
    • handleExecuteOrders

      public abstract void handleExecuteOrders()
      Handler method to execute orders
    • printInvalidCommandMessage

      public void printInvalidCommandMessage()
      Prints out and invalid command message