-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRobotPlayer.java
42 lines (38 loc) · 1.28 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
package team122;
import battlecode.common.RobotController;
import battlecode.common.RobotType;
import team122.robot.Artillery;
import team122.robot.Generator;
import team122.robot.HQ;
import team122.robot.Soldier;
import team122.robot.Supplier;
/** The example funcs player is a player meant to demonstrate basic usage of the most common commands.
* Robots will move around randomly, occasionally mining and writing useless messages.
* The HQ will spawn soldiers continuously.
*/
public class RobotPlayer {
public static void run(RobotController rc) {
RobotInformation info = new RobotInformation(rc);
System.out.println(rc.getType());
if (rc.getType() == RobotType.HQ) {
new HQ(rc, info).run();
} else if (rc.getType() == RobotType.SOLDIER) {
new Soldier(rc, info).run();
} else {
if (rc.getType() == RobotType.ARTILLERY) {
System.out.println("Running Artillery!");
new Artillery(rc, info).run();
} else if (rc.getType() == RobotType.GENERATOR) {
System.out.println("Creating Generator!");
new Generator(rc, info).run();
} else if (rc.getType() == RobotType.SUPPLIER) {
System.out.println("Creating Supplier!");
new Supplier(rc, info).run();
}
}
// fell out
while(true) {
rc.yield();
}
}
}