File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed
main/kotlin/sc/plugin2025
test/kotlin/sc/plugin2025 Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,12 @@ package sc.plugin2025
2
2
3
3
import com.thoughtworks.xstream.annotations.XStreamAlias
4
4
import com.thoughtworks.xstream.annotations.XStreamAsAttribute
5
- import com.thoughtworks.xstream.annotations.XStreamImplicit
6
5
import sc.api.plugins.Team
7
6
import sc.framework.PublicCloneable
8
7
import sc.plugin2025.GameRuleLogic.calculateCarrots
9
8
import sc.plugin2025.util.HuIConstants
10
9
11
- @XStreamAlias(" player " )
10
+ @XStreamAlias(" hare " )
12
11
data class Hare (
13
12
@XStreamAsAttribute val team : Team ,
14
13
@XStreamAsAttribute var position : Int = 0 ,
Original file line number Diff line number Diff line change @@ -34,17 +34,17 @@ class GameStateTest: WordSpec({
34
34
}
35
35
" produce nice XML" {
36
36
Hare (Team .TWO , lastAction = EatSalad ) shouldSerializeTo """
37
- <player team="TWO" position="0" salads="5" carrots="68">
37
+ <hare team="TWO" position="0" salads="5" carrots="68">
38
38
<lastAction class="eatsalad"/>
39
39
<cards/>
40
- </player >
40
+ </hare >
41
41
""" .trimIndent()
42
42
Hare (Team .TWO , cards = arrayListOf(Card .HURRY_AHEAD )) shouldSerializeTo """
43
- <player team="TWO" position="0" salads="5" carrots="68">
43
+ <hare team="TWO" position="0" salads="5" carrots="68">
44
44
<cards>
45
45
<card>HURRY_AHEAD</card>
46
46
</cards>
47
- </player >
47
+ </hare >
48
48
""" .trimIndent()
49
49
50
50
Advance (5, Card .EAT_SALAD ) shouldSerializeTo """
@@ -69,16 +69,16 @@ class GameStateTest: WordSpec({
69
69
<field>HARE</field>
70
70
<field>GOAL</field>
71
71
</board>
72
- <player team="TWO" position="0" salads="5" carrots="68">
72
+ <hare team="TWO" position="0" salads="5" carrots="68">
73
73
<lastAction class="advance" distance="5"/>
74
74
<cards>
75
75
<card>SWAP_CARROTS</card>
76
76
</cards>
77
- </player >
78
- <player team="ONE" position="3" salads="5" carrots="68">
77
+ </hare >
78
+ <hare team="ONE" position="3" salads="5" carrots="68">
79
79
<lastAction class="card">EAT_SALAD</lastAction>
80
80
<cards/>
81
- </player >
81
+ </hare >
82
82
<lastMove class="advance" distance="5">
83
83
<card>EAT_SALAD</card>
84
84
</lastMove>
You can’t perform that action at this time.
0 commit comments