Made team a separate class

This commit is contained in:
Anuken
2019-12-25 19:07:04 -05:00
parent 8ac0949ddf
commit 9016c12d16
26 changed files with 86 additions and 85 deletions

View File

@@ -146,7 +146,7 @@ public class Tile implements Position, TargetTrait{
}
public void setTeam(Team team){
this.team = (byte)team.ordinal();
this.team = (byte) (int) team.id;
}
public byte getTeamID(){
@@ -156,7 +156,7 @@ public class Tile implements Position, TargetTrait{
public void setBlock(@NonNull Block type, Team team, int rotation){
preChanged();
this.block = type;
this.team = (byte)team.ordinal();
this.team = (byte) (int) team.id;
this.rotation = (byte)Mathf.mod(rotation, 4);
changed();
}

View File

@@ -58,7 +58,7 @@ public class CommandCenter extends Block{
ObjectSet<Tile> set = indexer.getAllied(tile.getTeam(), BlockFlag.comandCenter);
if(set.size == 1){
for(BaseUnit unit : unitGroups[tile.getTeam().ordinal()].all()){
for(BaseUnit unit : unitGroups[(int) tile.getTeam().id].all()){
unit.onCommand(UnitCommand.all[0]);
}
}
@@ -116,7 +116,7 @@ public class CommandCenter extends Block{
Team team = (player == null ? tile.getTeam() : player.getTeam());
for(BaseUnit unit : unitGroups[team.ordinal()].all()){
for(BaseUnit unit : unitGroups[(int) team.id].all()){
unit.onCommand(command);
}