Package org.bitsquad.warzone.continent
Class Continent
java.lang.Object
org.bitsquad.warzone.continent.Continent
Represents a Continent Object
This class defines a continent with its ID, its constituent Countries and its bonus value.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCountry
(int p_countryId, String p_countryName) Method to add a CountryGetter method for Countries hashmapint
getId()
Getter method of continentId.getName()
int
getValue()
getter method of the bonus value of continentvoid
removeCountry
(int p_countryId) Method to remove a country using country Idvoid
setCountries
(HashMap<Integer, Country> p_countries) Setter method of countries hashmap.void
setId
(int p_continentId) Setter method of continentId.void
void
setValue
(int p_bonusValue) Setter method of bonus value
-
Constructor Details
-
Continent
public Continent()Default Constructor -
Continent
public Continent(int p_continentId, int p_bonusValue) Parameterized Constructor- Parameters:
p_continentId
- continent IDp_bonusValue
- continents' bonus value
-
Continent
-
-
Method Details
-
getId
public int getId()Getter method of continentId.- Returns:
- the id of the continent
-
setId
public void setId(int p_continentId) Setter method of continentId.- Parameters:
p_continentId
- the continent id
-
setName
-
getName
-
getValue
public int getValue()getter method of the bonus value of continent- Returns:
- d_bonusValue the bonus value of continent
-
setValue
public void setValue(int p_bonusValue) Setter method of bonus value- Parameters:
p_bonusValue
- the bonus value of the continent
-
getCountries
Getter method for Countries hashmap- Returns:
- the hashmap of countries
-
setCountries
Setter method of countries hashmap.- Parameters:
p_countries
- the hashmap of countries
-
addCountry
Method to add a Country- Parameters:
p_countryId
- the country idp_countryName
- the name of the country
-
removeCountry
public void removeCountry(int p_countryId) Method to remove a country using country Id- Parameters:
p_countryId
- the country id
-