Package Files
Class Territory
java.lang.Object
Files.Territory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addNeighbor
(Territory neighbor) Adds a neighbor to the neighbors listdetermineNumDice
(boolean attack, String territoryName) Accessor method for the neighbors instance variablegetOwner()
Accessor method for playerOwner insance variableAccessor method for the pieces instance variableAccessor method for the territoryName instance variablevoid
Sets the owner of the territory objectvoid
setTerritoryName
(String name) Sets the name of the territory
-
Constructor Details
-
Territory
Constructs a Territory object with the continent- Parameters:
name
- name of territory
-
-
Method Details
-
getNeighbors
Accessor method for the neighbors instance variable- Returns:
- ArrayList
the list of neighboring territories
-
addNeighbor
Adds a neighbor to the neighbors list- Parameters:
neighbor
- the neighboring territory to add
-
setTerritoryName
Sets the name of the territory- Parameters:
name
- the name to assign to the territory
-
getTerritoryName
Accessor method for the territoryName instance variable- Returns:
- String the name of the territory
-
setOwner
Sets the owner of the territory object- Parameters:
playerNum
- the number of the player that is being set as the owner
-
getOwner
Accessor method for playerOwner insance variable- Returns:
- Integer the number associated with the player who owns the territory
-
getPieces
Accessor method for the pieces instance variable- Returns:
- ArrayList
the list of game pieces in the territory
-
determineNumDice
-