-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSeason.java
More file actions
126 lines (110 loc) · 3.59 KB
/
Season.java
File metadata and controls
126 lines (110 loc) · 3.59 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import java.util.Hashtable;
import java.util.LinkedList;
public class Season {
private SecretMatchMaker secretMatchMaker;
private boolean isQueer;
private int numPairs;
private boolean knowAllBeams;
private LinkedList<Match> correctMatches;
private LinkedList<Match> nonMatches;
private LinkedList<Match> unconfirmed;
private LinkedList<Person> contestants;
private Picks selection;
private int obtainedBeams;
private int unkownBeams;
public Season( String[][] names, boolean[][] gender) {
secretMatchMaker = new SecretMatchMaker();
contestants = secretMatchMaker.makeCast(names, gender);
System.out.println(secretMatchMaker.toString());
correctMatches = new LinkedList<>();
nonMatches = new LinkedList<>();
unconfirmed = new LinkedList<>();
this.isQueer = false;
numPairs =10;
knowAllBeams = false;
obtainedBeams =0;
unkownBeams =0;
}
public Season( String[][] names, boolean[][] gender, LinkedList<Integer> order) {
secretMatchMaker = new SecretMatchMaker();
contestants = secretMatchMaker.makeCastNoShuffle(names, gender, order);
System.out.println(secretMatchMaker.toString());
correctMatches = new LinkedList<>();
nonMatches = new LinkedList<>();
unconfirmed = new LinkedList<>();
this.isQueer = false;
numPairs =10;
knowAllBeams = false;
obtainedBeams =0;
unkownBeams =0;
}
public Season( String[][] names) {
secretMatchMaker = new SecretMatchMaker();
contestants = secretMatchMaker.makeCast(names);
correctMatches = new LinkedList<>();
nonMatches = new LinkedList<>();
unconfirmed = new LinkedList<>();
isQueer = true;
numPairs =8;
knowAllBeams = false;
obtainedBeams =0;
unkownBeams =0;
}
public LinkedList<Person> getContestants() {
return contestants;
}
public LinkedList<Person>[] getContestantsSplit() {
LinkedList<Person> l1 = new LinkedList<>();
LinkedList<Person> l2 = new LinkedList<>();
for(int i=0; i<contestants.size(); i++){
if(contestants.get(i).isMale()){
l1.add(contestants.get(i));
}
else{
l2.add(contestants.get(i));
}
}
return new LinkedList[]{l1,l2};
}
public int ceremony(Picks p){
return secretMatchMaker.ceremony(p);
}
public boolean truthBoth(Match m){
return secretMatchMaker.isMatch(m.getP1(), m.getP2());
}
public int playSeason(){
//loop of truth booth and ceremony
return 0;
}
public void confirmMatch(Match m){
correctMatches.add(m);
m.setmatch(true);
}
public void confirmNonMatch(Match m){
nonMatches.add(m);
m.setmatch(false);
}
public void recordCeramonyFindingsfromSwap(int newbeams, int oldbeams, LinkedList<Match> newPairs) {
unkownBeams = newbeams - oldbeams;
if(unkownBeams == 0){
nonMatches.addAll(newPairs);
}
else{
if(unconfirmed.size() == 0 && unkownBeams == newPairs.size()){
for(int i=0; i< newPairs.size(); i++) {
confirmMatch(newPairs.get(i));
}
}
else{
unconfirmed.addAll(newPairs);
}
}
}
public void recordTruthBoth(Match m){
if(secretMatchMaker.isMatch(m.getP2(),m.getP2())){
confirmMatch(m);
}
else{
}
}
}