File | Line |
---|
cz/cuni/amis/pogamut/defcon/utils/quadtree/BuildingPlacementQuadTreeLabellingMethod.java | 19 |
cz/cuni/amis/pogamut/defcon/utils/quadtree/UnitPlacementQuadTreeLabellingMethod.java | 19 |
public UnitPlacementQuadTreeLabellingMethod(DefConWorldView worldview,
Logger log) {
this.worldview = worldview;
this.log = log;
}
@Override
public boolean label(QuadTreeNode node) {
if (node.isLabeled()) {
if (node.getNodes() != null &&
(node.getFirst().isLabeled() ||
node.getSecond().isLabeled() ||
node.getThird().isLabeled() ||
node.getFourth().isLabeled())) {
return true;
}
node.setLabel(false);
return false;
}
boolean b = node.getNodes() == null && worldview.getGameInfo()
.isValidShipPlacementLocation( |
File | Line |
---|
cz/cuni/amis/pogamut/defcon/communication/worldview/NativeMapSource.java | 180 |
cz/cuni/amis/pogamut/defcon/communication/worldview/modules/grid/basic/SymmetricGridCell.java | 69 |
if (x < -180f || x > 180f || y < -90f || y > 90f)
return false;
switch (flag) {
case SEA:
return gameInfo.isValidTerritory(-1, x, y, true);
case LAND:
return gameInfo.isValidTerritory(-1, x, y, false);
case OWN_TERRITORY: {
int id = gameInfo.getOwnTeamId();
return gameInfo.isValidTerritory(id, x, y, false)
|| gameInfo.isValidTerritory(id, x, y, true);
}
case ENEMY_TERRITORY: {
Boolean ok = false;
for (int id : gameInfo.getEnemyTeamIds()) {
if (ok = gameInfo.isValidTerritory(id, x, y, false) || |