-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPropertySet.java
More file actions
63 lines (47 loc) · 1.41 KB
/
Copy pathPropertySet.java
File metadata and controls
63 lines (47 loc) · 1.41 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
Nick Soetaert
A PropertySet represents the set of cards that forms from stacking
one or more cards of the same color together.
Parent: N/A
Children: N/A
*/
import java.util.ArrayList;
import java.util.List;
public class PropertySet {
private boolean _canBuild;
private int _setSize;
// Represents all cards in a given stack, including properties, wild, and structures.
public ArrayList<Card> cardSet = new ArrayList<>();
// Represents the possible rent prices that can apply to those cards.
protected RentPrice _rentPrice;
// Pre: A propertyCard is being passed
// Post: A PropertySet is initialized
PropertySet(PropertyCard card){
_rentPrice = new RentPrice(card.getCurrColor());
}
//Helper function to display cards while game is text based
public void displayCards(){
System.out.println("~~~~~~Property Set~~~~~~");
for(Card i : cardSet){
System.out.println(i.getName());
}
System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~");
}
// Pre: A PropertySet has been initialized, and a Card is passed
// Post: A card has been added to PropertySet
public void addCard(Card newCard){
cardSet.add(newCard);
}
public void removeCard(Card oldCard){
cardSet.remove(oldCard);
}
public int getCurrentSize(){
return cardSet.size();
}
public int getFullSetSize(){
return _setSize;
}
public int getRent(){
return _rentPrice.getRent(cardSet.size());
}
}