Class Phase
java.lang.Object
org.bitsquad.warzone.gameengine.phase.Phase
- Direct Known Subclasses:
GameFinished,IssueOrderPostDeploy,IssueOrderPreDeploy,OrderExecution,StartupMapEditing
Phase interface. Represents the state in State Pattern
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidhandleAdvance(String p_countryNameFrom, String p_targetCountryName, int p_armyUnits) Handler method for advance commandabstract voidhandleAirlift(int p_sourceCountryId, int p_targetCountryId, int p_numArmies) Handler method for airlift commandabstract voidHandler method for assigncountries commandabstract voidhandleBlockade(int p_targetCountryId) Handler method for blockade commandabstract voidhandleBomb(int p_countryId) Handler method for bomb commandabstract voidHandler method for commit commandabstract voidhandleDeployArmy(int p_targetCountryId, int p_armyUnits) Handler method for deploy commandabstract voidhandleEditContinent(int[] p_addArray, int[] p_removeIds) Handler for editcontinent commandabstract voidhandleEditCountry(int[] p_addIds, int[] p_removeIds) Handler method for editcountry commandabstract voidhandleEditMap(String p_filename) Handler for editmap commandabstract voidhandleEditNeighbor(int[] p_addIds, int[] p_removeIds) Handler method for editneighbor commandabstract voidHandler method to execute ordersabstract voidhandleGamePlayer(String[] p_addNames, String[] p_removeNames) Handler method for gameplayer commandabstract voidhandleLoadMap(String p_filename) Handler for loadmap commandabstract voidhandleNegotiate(int p_targetPlayerId) Handler method for negotiate commandabstract voidhandleSaveMap(String p_filename, boolean p_saveAsConquestMap) Handler for savemap commandabstract voidHandler for validatemap commandvoidPrints out and invalid command message
-
Constructor Details
-
Phase
Parameterized Constructor- Parameters:
p_gameEngine- GameEngine
-
-
Method Details
-
handleLoadMap
Handler for loadmap command- Parameters:
p_filename- String filename- Throws:
Exception
-
handleEditMap
Handler for editmap command- Parameters:
p_filename- String filename- Throws:
IOException
-
handleSaveMap
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 addp_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 addp_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
Handler method for gameplayer command- Parameters:
p_addNames- names to addp_removeNames- names to remove
-
handleAssignCountries
Handler method for assigncountries command- Throws:
Exception
-
handleDeployArmy
Handler method for deploy command- Parameters:
p_targetCountryId- Target Country IDp_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 Namep_targetCountryName- Target Country Namep_armyUnits- Number of army units- Throws:
Exception
-
handleBomb
Handler method for bomb command- Parameters:
p_countryId- Country ID- Throws:
Exception
-
handleBlockade
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
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
-