Skip to content

Commit 94f8856

Browse files
author
Xerus
committed
feat(plugin): add abstract destination getter for Move
1 parent cb47be5 commit 94f8856

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

gradle/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ tasks {
9191
println("Beschreibung: $desc")
9292
exec { commandLine("git", "add", "gradle.properties") }
9393
exec { commandLine("git", "commit", "-m", "release: $newVersion", "--no-verify") }
94-
exec { commandLine("git", "tag", newVersion, "-m", "$desc") }
94+
exec { commandLine("git", "tag", newVersion, "-m", desc) }
9595
exec { commandLine("git", "push", "--follow-tags") }
9696
}
9797
}

plugin/src/shared/sc/plugin2020/Move.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,24 @@ import sc.api.plugins.IMove
55
import sc.plugin2020.util.CubeCoordinates
66

77
/* NOTE: Remember to add all these classes to classesToRegister in sc/plugin2020/util/Configuration.kt */
8-
sealed class Move: IMove
8+
sealed class Move: IMove {
9+
abstract val destination: CubeCoordinates?
10+
}
911

1012
@XStreamAlias(value = "setmove")
11-
data class SetMove(val piece: Piece, val destination: CubeCoordinates): Move() {
13+
data class SetMove(val piece: Piece, override val destination: CubeCoordinates): Move() {
1214
override fun toString() = String.format("Set %s %s to %s", this.piece.owner, this.piece.type, this.destination)
1315
}
1416

1517
@XStreamAlias(value = "dragmove")
16-
data class DragMove(val start: CubeCoordinates, val destination: CubeCoordinates): Move() {
18+
data class DragMove(val start: CubeCoordinates, override val destination: CubeCoordinates): Move() {
1719
override fun toString() = String.format("Drag from %s to %s", this.start, this.destination)
1820
}
1921

2022
@XStreamAlias(value = "skipmove")
2123
object SkipMove: Move() {
24+
override val destination: CubeCoordinates?
25+
get() = null
2226
override fun equals(other: Any?) = other is SkipMove
2327
override fun toString() = "SkipMove"
2428
}

0 commit comments

Comments
 (0)