Added spatial indexing of tile targets, many bugfixes

This commit is contained in:
Anuken
2018-06-20 22:56:53 -04:00
parent 45da578756
commit ca30f49481
11 changed files with 105 additions and 52 deletions

View File

@@ -76,6 +76,18 @@ public class TeamInfo {
return ally ? enemies : allies;
}
/**Returns a set of all teams that are allies of this team.
* For teams not active, an empty set is returned.*/
public ObjectSet<Team> alliesOf(Team team) {
boolean ally = allies.contains(team);
boolean enemy = enemies.contains(team);
//this team isn't even in the game, so target everything!
if(!ally && !enemy) return allTeams;
return !ally ? enemies : allies;
}
/**Returns a set of all teams that are enemies of this team.
* For teams not active, an empty set is returned.*/
public ObjectSet<TeamData> enemyDataOf(Team team) {