Correct names for buildings
This commit is contained in:
@@ -64,7 +64,7 @@ public class SectorInfo{
|
||||
//update core items
|
||||
coreItems.clear();
|
||||
|
||||
CoreEntity entity = state.rules.defaultTeam.core();
|
||||
CoreBuild entity = state.rules.defaultTeam.core();
|
||||
|
||||
if(entity != null){
|
||||
ItemModule items = entity.items;
|
||||
@@ -97,7 +97,7 @@ public class SectorInfo{
|
||||
updateCoreDeltas();
|
||||
}
|
||||
|
||||
CoreEntity ent = state.rules.defaultTeam.core();
|
||||
CoreBuild ent = state.rules.defaultTeam.core();
|
||||
|
||||
//refresh throughput
|
||||
if(time.get(refreshPeriod)){
|
||||
@@ -141,7 +141,7 @@ public class SectorInfo{
|
||||
}
|
||||
|
||||
private void updateCoreDeltas(){
|
||||
CoreEntity ent = state.rules.defaultTeam.core();
|
||||
CoreBuild ent = state.rules.defaultTeam.core();
|
||||
for(int i = 0; i < lastCoreItems.length; i++){
|
||||
lastCoreItems[i] = ent == null ? 0 : ent.items.get(i);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,8 @@ public class Team implements Comparable<Team>{
|
||||
return state.teams.get(this);
|
||||
}
|
||||
|
||||
public @Nullable CoreEntity core(){
|
||||
public @Nullable
|
||||
CoreBuild core(){
|
||||
return data().core();
|
||||
}
|
||||
|
||||
@@ -103,7 +104,7 @@ public class Team implements Comparable<Team>{
|
||||
return state.teams.areEnemies(this, other);
|
||||
}
|
||||
|
||||
public Seq<CoreEntity> cores(){
|
||||
public Seq<CoreBuild> cores(){
|
||||
return state.teams.cores(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,15 +21,17 @@ public class Teams{
|
||||
active.add(get(Team.crux));
|
||||
}
|
||||
|
||||
public @Nullable CoreEntity closestEnemyCore(float x, float y, Team team){
|
||||
public @Nullable
|
||||
CoreBuild closestEnemyCore(float x, float y, Team team){
|
||||
for(Team enemy : team.enemies()){
|
||||
CoreEntity tile = Geometry.findClosest(x, y, enemy.cores());
|
||||
CoreBuild tile = Geometry.findClosest(x, y, enemy.cores());
|
||||
if(tile != null) return tile;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public @Nullable CoreEntity closestCore(float x, float y, Team team){
|
||||
public @Nullable
|
||||
CoreBuild closestCore(float x, float y, Team team){
|
||||
return Geometry.findClosest(x, y, get(team).cores);
|
||||
}
|
||||
|
||||
@@ -37,10 +39,10 @@ public class Teams{
|
||||
return get(team).enemies;
|
||||
}
|
||||
|
||||
public boolean eachEnemyCore(Team team, Boolf<CoreEntity> ret){
|
||||
public boolean eachEnemyCore(Team team, Boolf<CoreBuild> ret){
|
||||
for(TeamData data : active){
|
||||
if(areEnemies(team, data.team)){
|
||||
for(CoreEntity tile : data.cores){
|
||||
for(CoreBuild tile : data.cores){
|
||||
if(ret.get(tile)){
|
||||
return true;
|
||||
}
|
||||
@@ -68,12 +70,12 @@ public class Teams{
|
||||
return map[team.id];
|
||||
}
|
||||
|
||||
public Seq<CoreEntity> playerCores(){
|
||||
public Seq<CoreBuild> playerCores(){
|
||||
return get(state.rules.defaultTeam).cores;
|
||||
}
|
||||
|
||||
/** Do not modify! */
|
||||
public Seq<CoreEntity> cores(Team team){
|
||||
public Seq<CoreBuild> cores(Team team){
|
||||
return get(team).cores;
|
||||
}
|
||||
|
||||
@@ -98,7 +100,7 @@ public class Teams{
|
||||
return active;
|
||||
}
|
||||
|
||||
public void registerCore(CoreEntity core){
|
||||
public void registerCore(CoreBuild core){
|
||||
TeamData data = get(core.team());
|
||||
//add core if not present
|
||||
if(!data.cores.contains(core)){
|
||||
@@ -113,7 +115,7 @@ public class Teams{
|
||||
}
|
||||
}
|
||||
|
||||
public void unregisterCore(CoreEntity entity){
|
||||
public void unregisterCore(CoreBuild entity){
|
||||
TeamData data = get(entity.team());
|
||||
//remove core
|
||||
data.cores.remove(entity);
|
||||
@@ -143,7 +145,7 @@ public class Teams{
|
||||
}
|
||||
|
||||
public class TeamData{
|
||||
public final Seq<CoreEntity> cores = new Seq<>();
|
||||
public final Seq<CoreBuild> cores = new Seq<>();
|
||||
public final Team team;
|
||||
public final BaseAI ai;
|
||||
public Team[] enemies = {};
|
||||
@@ -166,7 +168,8 @@ public class Teams{
|
||||
return cores.isEmpty();
|
||||
}
|
||||
|
||||
public @Nullable CoreEntity core(){
|
||||
public @Nullable
|
||||
CoreBuild core(){
|
||||
return cores.isEmpty() ? null : cores.first();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user