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 void
handleAdvance
(String p_countryNameFrom, String p_targetCountryName, int p_armyUnits) Handler method for advance commandabstract void
handleAirlift
(int p_sourceCountryId, int p_targetCountryId, int p_numArmies) Handler method for airlift commandabstract void
Handler method for assigncountries commandabstract void
handleBlockade
(int p_targetCountryId) Handler method for blockade commandabstract void
handleBomb
(int p_countryId) Handler method for bomb commandabstract void
Handler method for commit commandabstract void
handleDeployArmy
(int p_targetCountryId, int p_armyUnits) Handler method for deploy commandabstract void
handleEditContinent
(int[] p_addArray, int[] p_removeIds) Handler for editcontinent commandabstract void
handleEditCountry
(int[] p_addIds, int[] p_removeIds) Handler method for editcountry commandabstract void
handleEditMap
(String p_filename) Handler for editmap commandabstract void
handleEditNeighbor
(int[] p_addIds, int[] p_removeIds) Handler method for editneighbor commandabstract void
Handler method to execute ordersabstract void
handleGamePlayer
(String[] p_addNames, String[] p_removeNames) Handler method for gameplayer commandabstract void
handleLoadMap
(String p_filename) Handler for loadmap commandabstract void
handleNegotiate
(int p_targetPlayerId) Handler method for negotiate commandabstract void
handleSaveMap
(String p_filename, boolean p_saveAsConquestMap) Handler for savemap commandabstract void
Handler for validatemap commandvoid
Prints 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
-