-
Notifications
You must be signed in to change notification settings - Fork 1
/
RobotPlayer.java
68 lines (65 loc) · 1.76 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
package team158;
import team158.buildings.AerospaceLab;
import team158.buildings.Barracks;
import team158.buildings.Headquarters;
import team158.buildings.Helipad;
import team158.buildings.MinerFactory;
import team158.buildings.SupplyDepot;
import team158.buildings.Tower;
import team158.units.Drone;
import team158.units.Launcher;
import team158.units.Miner;
import team158.units.Missile;
import team158.units.beaver.Beaver;
import team158.units.soldier.Soldier;
import battlecode.common.*;
public class RobotPlayer {
private static RobotController rc;
private static Robot robot;
public static void run(RobotController r) {
rc = r;
if (rc.getType() == RobotType.MISSILE) {
robot = new Missile(rc);
}
else if (rc.getType() == RobotType.HQ) {
robot = new Headquarters(rc);
}
else if (rc.getType() == RobotType.TOWER) {
robot = new Tower(rc);
}
else if (rc.getType() == RobotType.SOLDIER) {
robot = new Soldier(rc);
}
else if (rc.getType() == RobotType.BEAVER) {
robot = new Beaver(rc);
}
else if (rc.getType() == RobotType.DRONE) {
robot = new Drone(rc);
}
else if (rc.getType() == RobotType.BARRACKS) {
robot = new Barracks(rc);
}
else if (rc.getType() == RobotType.MINER) {
robot = new Miner(rc);
}
else if (rc.getType() == RobotType.MINERFACTORY) {
robot = new MinerFactory(rc);
}
else if (rc.getType() == RobotType.HELIPAD) {
robot = new Helipad(rc);
}
else if (rc.getType() == RobotType.SUPPLYDEPOT) {
robot = new SupplyDepot(rc);
}
else if (rc.getType() == RobotType.AEROSPACELAB) {
robot = new AerospaceLab(rc);
}
else if (rc.getType() == RobotType.LAUNCHER) {
robot = new Launcher(rc);
}
while (true) {
robot.move();
rc.yield();
}
}
}