forked from donald-pinckney/Final-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStructureOutline.txt
46 lines (42 loc) · 1.44 KB
/
StructureOutline.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Note that I did not mark which properties are let or var, this is for you to figure out. In general, make this let unless there is good reason for them to be var.
KonaneGame
- init(blackIsHuman: Bool, whiteIsHuman: Bool)
- private gameState: KonaneGameState
- private blackInputSource: KonaneMoveInputSource
- private whiteInputSource: KonaneMoveInputSource
- play() -> Bool // Returns true if black wins.
- private displayBoard()
KonaneGameState
- width: Int = 16
- height: Int = 16
- init()
- private internal board data storage
- private isBlackTurn: Bool
- getIsBlackTurn() -> Bool
- color(atX: Int, atY: Int) -> KonaneColor // Bottom left, 0-indexed
- isValid(move: KonaneMove) -> Bool
- isValid(blackRemove: (x: Int, y: Int)) -> Bool
- isValid(whiteRemove: (x: Int, y: Int)) -> Bool
- perform(move: KonaneMove)
- perform(blackRemove: (x: Int, y: Int))
- perform(whiteRemove: (x: Int, y: Int))
- didBlackWin() -> Bool
- didWhiteWin() -> Bool
enum KonaneColor {
case black, white, empty
}
KonaneMove
- init(fromX: Int, fromY: Int, toX: Int, toY: Int)
- fromX
- fromY
- toX
- toY
KonaneMoveInputSource
- init(isBlack: Bool)
- isBlack
- removeFirstPiece(gameState: KonaneGameState) -> (x: Int, y: Int) (should override)
- removeSecondPiece(gameState: KonaneGameState) -> (x: Int, y: Int) (should override)
- nextMove(gameState: KonaneGameState) -> KonaneMove
Subclasses:
KonaneMoveInputSourceHuman
[TeamName]_KonaneMoveInputSourceAI