File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed
plugin2026/src/main/kotlin/sc/plugin2026 Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ class Field @JvmOverloads constructor(
42
42
43
43
val piranha: Optional <PlayerColor >
44
44
get() {
45
- if (state == FieldState .RED ) return Optional .of(Team .ONE )
46
- else if (state == FieldState .BLUE ) return Optional .of(Team .TWO )
45
+ if (state == FieldState .ONE ) return Optional .of(Team .ONE )
46
+ else if (state == FieldState .TWO ) return Optional .of(Team .TWO )
47
47
48
48
return Optional .empty()
49
49
}
Original file line number Diff line number Diff line change 1
1
package sc.plugin2026
2
2
3
+ import sc.api.plugins.Team
4
+
3
5
enum class FieldState {
4
- RED ,
5
- BLUE ,
6
+ ONE ,
7
+ TWO ,
6
8
OBSTRUCTED ,
7
9
EMPTY ;
8
10
9
11
override fun toString () = when (this ) {
10
- OBSTRUCTED -> " Obstructed "
11
- RED -> " Red "
12
- BLUE -> " Blue "
12
+ OBSTRUCTED -> " Krake "
13
+ ONE -> " Eins "
14
+ TWO -> " Zwei "
13
15
else -> " empty"
14
16
}
15
17
16
18
fun asLetter () = when (this ) {
17
19
OBSTRUCTED -> ' O'
18
- RED -> ' R'
19
- BLUE -> ' B'
20
+ ONE -> ' R'
21
+ TWO -> ' B'
20
22
else -> ' '
21
23
}
22
24
23
25
companion object {
24
26
@JvmStatic
25
- fun from (color : PlayerColor ): FieldState {
26
- return when (color ) {
27
- Team .ONE -> RED
28
- Team .TWO -> BLUE
27
+ fun from (team : Team ): FieldState {
28
+ return when (team ) {
29
+ Team .ONE -> ONE
30
+ Team .TWO -> TWO
29
31
}
30
32
}
31
33
}
You can’t perform that action at this time.
0 commit comments