-
Notifications
You must be signed in to change notification settings - Fork 0
/
Squad.java
52 lines (45 loc) · 1.23 KB
/
Squad.java
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
import bc.*;
import java.util.ArrayList;
import java.util.Comparator;
/*
Subclasses of these objects actually issue the move commands for their units
*/
public class Squad{
ArrayList<Integer> units;
int urgency;
MapLocation targetLoc;
ArrayList<UnitType> requestedUnits;
GameController gc;
InfoManager infoMan;
Objective objective;
public Squad(InfoManager im){
units = new ArrayList<Integer>();
urgency = 0;
targetLoc = null;
requestedUnits = new ArrayList<UnitType>();
objective = Objective.NONE;
infoMan = im;
gc = infoMan.gc;
}
public void update(){
// managers will update squad needs
}
public void move(Nav nav){
// actually move the units
}
public void removeUnit(int id){
units.remove(units.indexOf(id));
}
//not sure if i flipped the order lol REFACTOR: <-- double check and remove comment @Eli
public static Comparator<Squad> byUrgency()
{
Comparator<Squad> comp = new Comparator<Squad>(){
@Override
public int compare(Squad s1, Squad s2)
{
return Integer.compare(s2.urgency, s1.urgency);
}
};
return comp;
}
}