Fixed Scoreboards!

This commit is contained in:
Mini-Chiss 2014-07-02 17:12:52 -07:00
parent d0fafce585
commit 22ceba9841
3 changed files with 29 additions and 27 deletions

View File

@ -1103,7 +1103,8 @@ public class Bridge extends TeamGame implements OreObsfucation
else
{
Scoreboard.WriteBlank();
Scoreboard.WriteOrdered("Score", team.GetColor() + "Players", team.GetPlayers(true).size(), true);
Scoreboard.Write(team.GetColor() + team.GetName() + " Team");
Scoreboard.Write(team.GetColor() + "" + team.GetPlayers(true).size() + " Alive");
}
}
}
@ -1131,12 +1132,12 @@ public class Bridge extends TeamGame implements OreObsfucation
if (time > 0)
{
Scoreboard.Write(C.cYellow + C.Bold + "Bridges Spawn");
Scoreboard.Write(C.cYellow + C.Bold + "Bridges In");
Scoreboard.Write(UtilTime.MakeStr(time, 0));
}
else
{
Scoreboard.Write(C.cYellow + C.Bold + "Bridges Down!");
Scoreboard.Write(C.cYellow + C.Bold + "FIGHT!");
}
Scoreboard.Draw();

View File

@ -247,7 +247,7 @@ public class TeamDeathmatch extends TeamGame
for (GameTeam team : this.GetTeamList())
{
//Display Individual Players
if (this.GetPlayers(false).size() < 10)
if (this.GetPlayers(false).size() <= 10)
{
Scoreboard.WriteBlank();
@ -270,7 +270,7 @@ public class TeamDeathmatch extends TeamGame
Scoreboard.WriteBlank();
Scoreboard.Write(team.GetColor() + team.GetName() + " Team");
Scoreboard.Write("" + team.GetPlayers(true).size() + team.GetColor() + "Alive");
Scoreboard.Write(team.GetColor() + "" + team.GetPlayers(true).size() + " Alive");
}
}

View File

@ -174,8 +174,8 @@ public class GameScoreboard
public void Draw()
{
//System.out.println();
//System.out.println("/////////////////////////");
System.out.println();
System.out.println("/////////////////////////");
//Generate Lines
ArrayList<String> newLines = new ArrayList<String>();
@ -207,7 +207,7 @@ public class GameScoreboard
}
//Find Changes
HashSet<Integer> toUpdate = new HashSet<Integer>();
HashSet<Integer> toAdd = new HashSet<Integer>();
HashSet<Integer> toDelete = new HashSet<Integer>();
for (int i=0 ; i<15 ; i++)
@ -217,7 +217,7 @@ public class GameScoreboard
{
if (_current[i] != null)
{
//System.out.println("Delete: " + i + " [" + _current[i] + "]");
System.out.println("Delete: " + i + " [" + _current[i] + "]");
toDelete.add(i);
}
@ -227,34 +227,35 @@ public class GameScoreboard
//Update or Add Row
if (_current[i] == null || !_current[i].equals(newLines.get(i)))
{
//System.out.println("Update: " + i + " [" + newLines.get(i) + "]");
toUpdate.add(i);
System.out.println("Update: " + i + " [" + newLines.get(i) + "]");
toDelete.add(i);
toAdd.add(i);
}
}
//Add/Update Elements
for (int i : toUpdate)
{
//Remove Old Line at Index
if (_current[i] != null)
ResetScore(_current[i]);
//Insert New Line
String newLine = newLines.get(i);
GetObjectiveSide().getScore(newLine).setScore(15-i);
_current[i] = newLine;
}
//Delete Elements
//Delete Elements - Must happen before Add
for (int i : toDelete)
{
//Remove Old Line at Index
if (_current[i] != null)
{
System.out.println("Deleting: " + i + " [" + _current[i] + "]");
ResetScore(_current[i]);
_current[i] = null;
}
}
//Add Elements
for (int i : toAdd)
{
//Insert New Line
String newLine = newLines.get(i);
GetObjectiveSide().getScore(newLine).setScore(15-i);
_current[i] = newLine;
System.out.println("Setting: " + (15-i) + " [" + newLine + "]");
}
}
public void Reset()