-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDroneMain.java
More file actions
45 lines (33 loc) · 1.45 KB
/
DroneMain.java
File metadata and controls
45 lines (33 loc) · 1.45 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
package battlehub;
import battleship.core.*;
import battleship.games.*;
import battleship.ships.*;
import java.util.*;
public class DroneMain {
public static void main(String[] args) {
int seed = (int) Math.floor(Math.random() * 100);
if (args.length >= 1) {
seed = Integer.parseInt(args[0]);
}
System.out.println("Seed: " + seed);
List<Spawn> c = new ArrayList<Spawn>();
// Team A
c.add(new Spawn(battleship.ships.DummyShip.class, "Team A"));
c.add(new Spawn(battleship.ships.DummyShip.class, "Team A"));
c.add(new Spawn(battleship.ships.DummyShip.class, "Team A"));
c.add(new Spawn(battleship.ships.DummyShip.class, "Team A"));
// Team B
c.add(new Spawn(battleship.ships.DummyShip.class, "Team B"));
c.add(new Spawn(battleship.ships.DummyShip.class, "Team B"));
c.add(new Spawn(battleship.ships.DummyShip.class, "Team B"));
c.add(new Spawn(battleship.ships.DummyShip.class, "Team B"));
// Drone
Class<? extends Ship> drone = battleship.ships.DroneShip.class;
DroneBattle battle = new DroneBattle(c, drone, seed);
battle.setMaxTurns(100);
battle.setArenaFile("files/drone-arena.txt");
battle.setTurnFile("files/drone-turns.txt");
battle.setLogFile("files/drone-log.txt");
battle.run();
}
}