Package breitband.game.board
Class Region
- java.lang.Object
-
- breitband.game.board.Region
-
public class Region extends java.lang.Object
Class containing all information regarding regions (acts like a struct)- Author:
- Klara Schöbel
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.HashMap<java.lang.String,City>
getCities()
getter for citiesCity
getCityByName(java.lang.String name)
getter for a city in this region by namejava.lang.String
getName()
getter for nameBorder[]
getPolygons()
getter for Polygons
-
-
-
Constructor Detail
-
Region
public Region(java.util.HashMap<java.lang.String,City> cities, java.lang.String name, Border[] polygons)
Constructs a region with cities, a name and borders- Parameters:
cities
- hashmap of all the cities (see alsogetCities()
)name
- name of the region (see alsogetName()
)polygons
- polygons representing the borders (see alsogetPolygons()
)
-
-
Method Detail
-
getCities
public java.util.HashMap<java.lang.String,City> getCities()
getter for cities- Returns:
- all the cities in this region as a Hashmap (hash-key of a city is the name of the city)
-
getCityByName
public City getCityByName(java.lang.String name)
getter for a city in this region by name- Parameters:
name
- Name of the city- Returns:
- the city with the given name for or null if the city is not in this region
-
getName
public java.lang.String getName()
getter for name- Returns:
- name of the city
-
getPolygons
public Border[] getPolygons()
getter for Polygons- Returns:
- the bounds of this region
-
-