Icons now display, blink when they are about to run off, and turn off after their time out

TokenType Enum now also has a timeout construction field
#story[1245]
This commit is contained in:
William Muir
2017-09-20 13:09:09 +12:00
parent 6cde016401
commit 034e4c252a
3 changed files with 71 additions and 25 deletions
@@ -40,7 +40,6 @@ public class ClientYacht extends Observable {
@FunctionalInterface
public interface PowerUpListener {
void notifyPowerUp(ClientYacht yacht, TokenType tokenType);
}
@@ -5,18 +5,21 @@ package seng302.model.token;
* Created by wmu16 on 28/08/17.
*/
public enum TokenType {
BOOST(0, "Boost"),
HANDLING(1, "Handling"),
BUMPER(2, "Bumper"),
WIND_WALKER(3, "Wind Walker"),
RANDOM(4, "Random");
BOOST(0, "Boost", 10_000),
HANDLING(1, "Handling", 10_000),
BUMPER(2, "Bumper", 10_000),
WIND_WALKER(3, "Wind Walker", 10_000),
RANDOM(4, "Random", 10_000);
private int value;
private String name;
private int timeout;
TokenType(int value, String name) {
TokenType(int value, String name, int timeout) {
this.value = value;
this.name = name;
this.timeout = timeout;
}
public int getValue() {
@@ -26,4 +29,8 @@ public enum TokenType {
public String getName() {
return name;
}
public int getTimeout() {
return timeout;
}
}