Example #1
0
  public void updateMap() {

    if (mapResetCounter < 0) {
      myMap = new InfoMap(controllers.myRC.getLocation());
      mapResetCounter = 100;
    }
    mapResetCounter--;

    for (RobotInfo info : controllers.allyImmobile) {
      if (info.chassis == Chassis.BUILDING) myMap.setBlocked(info.location, true);
    }
    for (RobotInfo info : controllers.enemyImmobile) {
      if (info.chassis == Chassis.BUILDING) myMap.setBlocked(info.location, true);
    }
    for (RobotInfo info : controllers.debris) {
      myMap.setBlocked(info.location, true);
    }
  }
Example #2
0
  public boolean isTraversable(MapLocation loc) {

    TerrainTile tile = controllers.myRC.senseTerrainTile(loc);
    return ((tile == null) || (tile == TerrainTile.LAND)) && (!myMap.isBlocked(loc));
  }