Skip to content

Commit 8f6c162

Browse files
committed
rename TextColor to Text to adhere to BWAPI
1 parent b3855c0 commit 8f6c162

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

src/main/java/bwapi/Game.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ public List<TilePosition> getStartLocations() {
14871487

14881488
/**
14891489
* Prints text to the screen as a notification. This function allows text
1490-
* formatting using {@link TextColor#formatText}.
1490+
* formatting using {@link Text#formatText}.
14911491
* <p>
14921492
* That text printed through this function is not seen by other players or in replays.
14931493
*

src/main/java/bwapi/Player.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -520,34 +520,34 @@ public Color getColor() {
520520
*
521521
* @return character code to use for text in Broodwar.
522522
*/
523-
public TextColor getTextColor() {
523+
public Text getTextColor() {
524524
switch (playerData.getColor()) {
525525
case 111: // red
526-
return TextColor.BrightRed;
526+
return Text.BrightRed;
527527
case 165: // blue
528-
return TextColor.Blue;
528+
return Text.Blue;
529529
case 159: // teal
530-
return TextColor.Teal;
530+
return Text.Teal;
531531
case 164: // purp
532-
return TextColor.Purple;
532+
return Text.Purple;
533533
case 156: // orange with fix from @n00byEdge
534-
return TextColor.Orange;
534+
return Text.Orange;
535535
case 19: // brown
536-
return TextColor.Brown;
536+
return Text.Brown;
537537
case 84: // white
538-
return TextColor.PlayerWhite;
538+
return Text.PlayerWhite;
539539
case 135: // yellow
540-
return TextColor.PlayerYellow;
540+
return Text.PlayerYellow;
541541
case 185: // green p9
542-
return TextColor.DarkGreen;
542+
return Text.DarkGreen;
543543
case 136: // p10
544-
return TextColor.LightYellow;
544+
return Text.LightYellow;
545545
case 134: // p11
546-
return TextColor.Tan;
546+
return Text.Tan;
547547
case 51: // p12
548-
return TextColor.GreyBlue;
548+
return Text.GreyBlue;
549549
default:
550-
return TextColor.Default;
550+
return Text.Default;
551551
}
552552
}
553553

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* <p>
66
* Such codes are used in calls to {@link Game#drawText}, {@link Game#printf}
77
*/
8-
public enum TextColor {
8+
public enum Text {
99
/**
1010
* Uses the previous color that was specified before the current one.
1111
*/
@@ -117,14 +117,14 @@ public enum TextColor {
117117

118118
final byte id;
119119

120-
TextColor(final int id) {
120+
Text(final int id) {
121121
this.id = (byte) id;
122122
}
123123

124124
/**
125125
* Format text with a textcolor to display on broodwar
126126
*/
127-
public static String formatText(final String text, final TextColor format) {
127+
public static String formatText(final String text, final Text format) {
128128
final byte[] data = text.getBytes();
129129
final int len = text.length();
130130
final byte[] formatted = new byte[len + 1];

0 commit comments

Comments
 (0)