File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
plugin2026/src/main/kotlin/sc/plugin2026 Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -4,13 +4,14 @@ import com.thoughtworks.xstream.annotations.XStreamAlias
4
4
import sc.api.plugins.MutableTwoDBoard
5
5
import sc.api.plugins.RectangularBoard
6
6
import sc.api.plugins.Team
7
+ import sc.api.plugins.deepCopy
7
8
import sc.plugin2026.FieldState.OBSTRUCTED
8
9
import sc.plugin2026.util.*
9
10
import kotlin.math.floor
10
11
11
12
/* * Spielbrett für Piranhas mit [PiranhaConstants.BOARD_LENGTH]² Feldern. */
12
13
@XStreamAlias(value = " board" )
13
- class Board (override val gameField : MutableTwoDBoard <Field > = randomFields()): RectangularBoard<Field>(gameField) {
14
+ class Board (gameField : MutableTwoDBoard <Field > = randomFields()): RectangularBoard<Field>(gameField) {
14
15
15
16
// TODO later
16
17
// override fun toString() =
@@ -27,6 +28,9 @@ class Board(override val gameField: MutableTwoDBoard<Field> = randomFields()): R
27
28
// return map.joinToString("\n", line + "\n", "\n" + line) { it.append('|').toString() }
28
29
// }
29
30
31
+ override fun clone (): Board =
32
+ Board (gameField.deepCopy())
33
+
30
34
companion object {
31
35
/* * Erstellt eine zufälliges Spielbrett. */
32
36
private fun randomFields (): Array <Array <Field >> {
@@ -67,4 +71,3 @@ class Board(override val gameField: MutableTwoDBoard<Field> = randomFields()): R
67
71
}
68
72
}
69
73
}
70
-
You can’t perform that action at this time.
0 commit comments