mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Added some general UI improvements such as autofilling the color field of the form, and looked at how best to deal with response packets, as it should be part of the spec.
tags: #story[1142]
This commit is contained in:
@@ -71,6 +71,7 @@ public class ClientYacht extends Observable {
|
||||
this.heading = 120.0; //In degrees
|
||||
this.currentVelocity = 0d;
|
||||
this.boatStatus = 1;
|
||||
this.colour = Color.rgb(0, 0, 0, 1.0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -8,12 +8,7 @@ import javafx.scene.paint.Color;
|
||||
public enum Colors {
|
||||
RED, PERU, GOLD, GREEN, BLUE, PURPLE, DEEPPINK, GRAY;
|
||||
|
||||
static Integer index = 0;
|
||||
|
||||
public static Color getColor() {
|
||||
if (index == 8) {
|
||||
index = 0;
|
||||
}
|
||||
return Color.valueOf(values()[index++].toString());
|
||||
public static Color getColor(Integer index) {
|
||||
return Color.valueOf(values()[index].toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class ServerYacht extends Observable {
|
||||
this.heading = 120.0; //In degrees
|
||||
this.currentVelocity = 0d; //in mms-1
|
||||
this.currentMarkSeqID = 0;
|
||||
this.boatColor = Color.rgb(0, 0, 0);
|
||||
this.boatColor = Colors.getColor(sourceId - 1);
|
||||
|
||||
this.hasEnteredRoundingZone = false;
|
||||
this.hasPassedLine = false;
|
||||
|
||||
Reference in New Issue
Block a user