Package Files

Class Territory

java.lang.Object
Files.Territory

public class Territory extends Object
  • Constructor Details

    • Territory

      public Territory(String name)
      Constructs a Territory object with the continent
      Parameters:
      name - name of territory
  • Method Details

    • getNeighbors

      public ArrayList<Territory> getNeighbors()
      Accessor method for the neighbors instance variable
      Returns:
      ArrayList the list of neighboring territories
    • addNeighbor

      public void addNeighbor(Territory neighbor)
      Adds a neighbor to the neighbors list
      Parameters:
      neighbor - the neighboring territory to add
    • setTerritoryName

      public void setTerritoryName(String name)
      Sets the name of the territory
      Parameters:
      name - the name to assign to the territory
    • getTerritoryName

      public String getTerritoryName()
      Accessor method for the territoryName instance variable
      Returns:
      String the name of the territory
    • setOwner

      public void setOwner(Integer playerNum)
      Sets the owner of the territory object
      Parameters:
      playerNum - the number of the player that is being set as the owner
    • getOwner

      public Integer getOwner()
      Accessor method for playerOwner insance variable
      Returns:
      Integer the number associated with the player who owns the territory
    • getPieces

      public ArrayList<GamePiece> getPieces()
      Accessor method for the pieces instance variable
      Returns:
      ArrayList the list of game pieces in the territory
    • determineNumDice

      public Integer determineNumDice(boolean attack, String territoryName)