-
Notifications
You must be signed in to change notification settings - Fork 0
/
RobotPlayer.java
90 lines (87 loc) · 1.79 KB
/
RobotPlayer.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
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
package team079;
import battlecode.common.*;
public class RobotPlayer {
public static BaseRobot myself;
public static void run(RobotController rc){
//Initialize myself to a type based off of what type of robot we are
switch(rc.getType()){
case HQ:
myself = new HQ(rc);
break;
case BEAVER:
myself = new Beaver(rc);
break;
case SUPPLYDEPOT:
myself = new SupplyDepot(rc);
break;
case TECHNOLOGYINSTITUTE:
myself = new TechnologyInstitute(rc);
break;
case COMPUTER:
myself = new Computer(rc);
break;
case TRAININGFIELD:
myself = new TrainingField(rc);
break;
case COMMANDER:
myself = new Commander(rc);
break;
case BARRACKS:
myself = new Barracks(rc);
break;
case SOLDIER:
myself = new Soldier(rc);
break;
case BASHER:
myself = new Basher(rc);
break;
case TANKFACTORY:
myself = new TankFactory(rc);
break;
case TANK:
myself = new Tank(rc);
break;
case HELIPAD:
myself = new Helipad(rc);
break;
case DRONE:
myself = new Drone(rc);
break;
case AEROSPACELAB:
myself = new AerospaceLab(rc);
break;
case LAUNCHER:
myself = new Launcher(rc);
break;
case HANDWASHSTATION:
myself = new SuperImportant(rc);
break;
case MINERFACTORY:
myself = new MinerFactory(rc);
break;
case MINER:
myself = new Miner(rc);
break;
case TOWER:
myself = new Tower(rc);
break;
case MISSILE:
Missile.missileInit(rc);
while(true){
try {
Missile.runs();
} catch (GameActionException e) {
e.printStackTrace();
}
}
}
//While true, run the run method in myself
while(true){
try{
myself.run();
}catch(GameActionException e){
e.printStackTrace();
}
}
}
}