Made team a separate class
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user