RuneHive-Game
Loading...
Searching...
No Matches
ValueIcon.java
Go to the documentation of this file.
1package com.runehive.content;
2
3import java.util.Optional;
4
5public enum ValueIcon {
6 NONE(-1),
9 GREEN(2),
10 BLUE(3),
11 RED(4);
12
13 private final int code;
14
16 this.code = code;
17 }
18
19 public static Optional<ValueIcon> lookup(int code) {
20 if (code < -1 || code > 4) {
21 return Optional.empty();
22 }
23
24 return Optional.of(ValueIcon.values()[code + 1]);
25 }
26
27 public int getCode() {
28 return code;
29 }
30
31}
static Optional< ValueIcon > lookup(int code)