Skip to content

Commit 1aaf295

Browse files
committed
fix(player): update package to 2023
1 parent 8c72db9 commit 1aaf295

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
lines changed

player/src/main/sc/player2022/Starter.java renamed to player/src/main/sc/player2023/Starter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package sc.player2022;
1+
package sc.player2023;
22

33
import jargs.gnu.CmdLineParser;
44
import org.slf4j.Logger;
@@ -7,7 +7,7 @@
77
import sc.networking.clients.LobbyClient;
88
import sc.player.IGameHandler;
99
import sc.player.IPlayerClient;
10-
import sc.player2022.logic.Logic;
10+
import sc.player2023.logic.Logic;
1111
import sc.shared.SharedConfiguration;
1212

1313
import java.io.File;

player/src/main/sc/player2022/logic/Logic.java renamed to player/src/main/sc/player2023/logic/Logic.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package sc.player2022.logic;
1+
package sc.player2023.logic;
22

33
import org.slf4j.Logger;
44
import org.slf4j.LoggerFactory;
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package sc.plugin2022
2+
3+
import io.kotest.core.spec.style.FunSpec
4+
import io.kotest.matchers.*
5+
import io.kotest.matchers.nulls.*
6+
import sc.api.plugins.Coordinates
7+
import sc.api.plugins.Vector
8+
import sc.helpers.shouldSerializeTo
9+
import sc.plugin2023.Move
10+
import sc.plugin2023.y
11+
import sc.protocol.room.RoomPacket
12+
13+
class MoveTest: FunSpec({
14+
val move = Move(Coordinates(0, 7), Coordinates(17, 5))
15+
context("Move manipulation") {
16+
test("reversal should not be equal") {
17+
move.reversed() shouldNotBe move
18+
move.reversed()!!.compareTo(move) shouldBe 0
19+
}
20+
test("double reversal should yield identity") {
21+
move.reversed()!!.reversed() shouldBe move
22+
}
23+
test("can't reverse penguin placement") {
24+
Move(null, Coordinates.origin).reversed().shouldBeNull()
25+
}
26+
}
27+
test("Move XML") {
28+
RoomPacket("hi", move) shouldSerializeTo """
29+
<room roomId="hi">
30+
<data class="move">
31+
<from x="0" y="7"/>
32+
<to x="17" y="5"/>
33+
</data>
34+
</room>
35+
""".trimIndent()
36+
Move.run(0 y 1, Vector(1, 1)) shouldSerializeTo """
37+
<move>
38+
<from x="0" y="1"/>
39+
<to x="1" y="2"/>
40+
</move>
41+
""".trimIndent()
42+
}
43+
})

0 commit comments

Comments
 (0)