Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions RobotPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ public class RobotPlayer{
static int[] zombieRounds;
static MapLocation[] zombieDenLocations;
static Collection<Integer> enemyArchonIDs;
static Collection<Tuple<Integer,MapLocation>> mostRecentEnemyArchonLocations;
// Collection of <Archon ID, Archon Location, Round that measurement was taken>
static Collection<Triple<Integer,MapLocation,Integer>> mostRecentEnemyArchonLocations;

/**
* run
Expand Down Expand Up @@ -78,10 +79,12 @@ public void run() {
for (Signal s : signals) {
// receive a message containing enemy archon ID
if (s.getTeam() == ourTeam) {
FancyMessage f = FancyMessage.getFromRecievedSignal(s);

}
// intercept a message containing enemy archon location
if (s.getTeam() == opponentTeam && enemyArchonIDs.contains(s.getID())) {
FancyMessage f = FancyMessage.getFromRecievedSignal(s);

}
if (s.getTeam() == ourTeam && rc.senseRobot(s.getID()).type == RobotType.ARCHON) {
Expand All @@ -104,9 +107,9 @@ public void run() {
}
}
}
// If there are enough scouts around, move out
if (RESOURCE_FUNCTIONS.numberOfRobotsInRadiusAndThoseRobots(RobotType.SOLDIER, RobotType.SOLDIER.sensorRadiusSquared, rc.getTeam()).first > 5) {

// If there are enough scouts around, move out towards enemy Archon
if (mostRecentEnemyArchonLocations.size() > 0 && RESOURCE_FUNCTIONS.numberOfRobotsInRadiusAndThoseRobots(RobotType.SOLDIER, RobotType.SOLDIER.sensorRadiusSquared, rc.getTeam()).first > 5) {
RESOURCE_FUNCTIONS.BUG(RESOURCE_FUNCTIONS.mostRecentEnemyArchonLocation());
}

} catch (Exception e) {
Expand Down Expand Up @@ -563,6 +566,21 @@ public static void collectEnemyArchonID() {
}
}
}

/**
* Get most recent enemy archon location
*/
public static MapLocation mostRecentEnemyArchonLocation() {
MapLocation latestArchonLocation = new MapLocation(0,0);
int latestRound = 0;
for (Triple<Integer, MapLocation, Integer> trip : mostRecentEnemyArchonLocations) {
if (trip.third > latestRound) {
latestRound = trip.third;
latestArchonLocation = trip.second;
}
}
return latestArchonLocation;
}

/**
* MapLocation[] inSightButOffMap
Expand Down