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
29 changes: 29 additions & 0 deletions RobotPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,35 @@ public static void collectEnemyArchonID() {
}
}
}

/**
* MapLocation[] inSightButOffMap
*
* Looks at all tiles in sight range, returns all those that are off the map
*
* @return array of MapLocations in sight but not on the map
*
*/
public static MapLocation[] inSightButOffMap(){
MapLocation[] allInSight = MapLocation.getAllMapLocationsWithinRadiusSq(rc.getLocation(),rc.getType.sensorRadiusSquared);
int numOffMap = 0;
for(int i = 0; i < allInSight.length; i++){
if(rc.onTheMap(allInSight[i])){
allInSight[i] = null;
}else{
numOffMap++;
}
}
MapLocation[] ret = new MapLocation[numOffMap];
int count = 0;
for(int i = 0; i < allInSight.length && count < ret.length; i++){
if(allInSight[i] != null){
ret[count] = allInSight[i];
count++;
}
}
return ret;
}
}

/**
Expand Down