Team#toString()

This commit is contained in:
Anuken
2019-12-26 20:20:12 -05:00
parent 954e26fc14
commit 684f3075cb
2 changed files with 8 additions and 3 deletions

View File

@@ -237,7 +237,7 @@ public class GroundUnit extends BaseUnit{
protected void moveAwayFromCore(){ protected void moveAwayFromCore(){
Team enemy = null; Team enemy = null;
for(Team team : Vars.team.enemies()){ for(Team team : team.enemies()){
if(team.active()){ if(team.active()){
enemy = team; enemy = team;
break; break;
@@ -245,7 +245,7 @@ public class GroundUnit extends BaseUnit{
} }
if(enemy == null){ if(enemy == null){
for(Team team : Vars.team.enemies()){ for(Team team : team.enemies()){
enemy = team; enemy = team;
break; break;
} }

View File

@@ -31,7 +31,7 @@ public class Team implements Comparable<Team>{
static{ static{
//create the whole 256 placeholder teams //create the whole 256 placeholder teams
for(int i = 6; i < all.length; i++){ for(int i = 6; i < all.length; i++){
new Team(i, "team#" + i, Color.HSVtoRGB(360f * (float)(i) / all.length, 100f, 100f, 1f)); new Team(i, "team#" + i, Color.HSVtoRGB(360f * (float)(i) / all.length * 10, 100f * 0.8f, 100f * 0.8f, 1f));
} }
} }
@@ -91,4 +91,9 @@ public class Team implements Comparable<Team>{
public int compareTo(Team team){ public int compareTo(Team team){
return Integer.compare(id, team.id); return Integer.compare(id, team.id);
} }
@Override
public String toString(){
return name;
}
} }