forked from tlmader/risk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContinent.java
More file actions
41 lines (34 loc) · 954 Bytes
/
Continent.java
File metadata and controls
41 lines (34 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import java.util.ArrayList;
/**
* Allows the creation of Risk Continent objects.
* @author Ted Mader
* @version Alpha
* @date 5/02/14
**/
public class Continent {
private String name;
private int bonusArmies;
private ArrayList<Country> countries;
public Continent(String name, int bonusArmies, ArrayList<Country> memberCountries) {
this.name = name;
this.bonusArmies = bonusArmies;
countries = memberCountries;
System.out.println("Created continent: " + name + "\nBonus armies: " + bonusArmies);
}
public String getName() {
return name;
}
/**
* Returns the number of bonus armies a player gets per round when the player controls this
* continent
**/
public int getBonusArmies() {
return bonusArmies;
}
/**
* Retuens a list of the country objects that are on this continent
**/
public ArrayList<Country> getMemberCountries() {
return countries;
}
}