aboutsummaryrefslogtreecommitdiff
path: root/doc/diagrams
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2021-06-12 10:58:21 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2021-06-12 10:58:21 +0200
commit4a39a8fd07e49db5feb0c403b784423f0b673f97 (patch)
treead53281fbd275b278445f0d28195040102943d39 /doc/diagrams
parente8a3007e25c32ed8014b5e524849dfb38e9bef13 (diff)
downloadimago-4a39a8fd07e49db5feb0c403b784423f0b673f97.tar.gz
imago-4a39a8fd07e49db5feb0c403b784423f0b673f97.zip
First MonteCarlo match simulations.
Diffstat (limited to 'doc/diagrams')
-rw-r--r--doc/diagrams/GameBoard.pumlc28
-rw-r--r--doc/diagrams/GameMove.pumlc20
-rw-r--r--doc/diagrams/GameState.pumlc16
-rw-r--r--doc/diagrams/GameTree.pumlc4
-rw-r--r--doc/diagrams/gameRepresentation.puml9
-rw-r--r--doc/diagrams/gtpEngine.puml15
6 files changed, 72 insertions, 20 deletions
diff --git a/doc/diagrams/GameBoard.pumlc b/doc/diagrams/GameBoard.pumlc
new file mode 100644
index 0000000..7a57b2d
--- /dev/null
+++ b/doc/diagrams/GameBoard.pumlc
@@ -0,0 +1,28 @@
+@startuml
+
+class GameBoard {
+ int[][] board
+ int capturesBlack
+ int capturesWhite
+
+ getBoard(self)
+ getBoardHeight(self)
+ getBoardWidth(self)
+ getDeepCopy(self)
+ getGroupLiberties(self, row, col)
+ getGroupLibertiesCount(self, row, col)
+ getGroupCells(self, row, col)
+ getGroupCellsCount(self, row, col)
+ moveAndCapture(self, row, col, player)
+ isMoveInBoardBounds(self, row, col)
+ isCellEmpty(self, row, col)
+ isCellEye(self, row, col)
+ isMoveSuicidal(self, row, col, player)
+ isMoveKoIllegal(self, row, col, player, prevBoards)
+ isPlayable(self, row, col, player, prevBoards)
+ score(self)
+ equals(self, otherBoard)
+ printBoard(self)
+}
+
+@enduml
diff --git a/doc/diagrams/GameMove.pumlc b/doc/diagrams/GameMove.pumlc
index 7dcb5e3..0f75edd 100644
--- a/doc/diagrams/GameMove.pumlc
+++ b/doc/diagrams/GameMove.pumlc
@@ -1,13 +1,23 @@
@startuml
class GameMove {
- int player
- int row
- int col
- int[2] makesKo
- int[] board
+ GameBoard board
GameMove[] nextMoves
GameMove previousMove
+ boolean isPass
+ int[2] coords
+
+ getRow(self)
+ getCol(self)
+ getPlayer(self)
+ getNextPlayer(self)
+ getGameLength(self)
+ getThisAndPrevBoards(self)
+ getPlayableVertices(self)
+ addMove(self, row, col)
+ addMoveForPlayer(self, row, col, player)
+ addPass(self)
+ printBoard(self)
}
@enduml
diff --git a/doc/diagrams/GameState.pumlc b/doc/diagrams/GameState.pumlc
index db39d8f..38e1397 100644
--- a/doc/diagrams/GameState.pumlc
+++ b/doc/diagrams/GameState.pumlc
@@ -1,14 +1,18 @@
@startuml
class GameState {
- int player
- int capturesBlack
- int capturesWhite
- List board
- List prevBoards # for ko
+ int size
GameTree gameTree
GameMove lastMove
- GameData gameData
+ 'GameData gameData
+
+ getCurrentPlayer(self)
+ getPlayerCode(self)
+ getBoard(self)
+ playMove(self, row, col)
+ playMoveForPlayer(self, row, col, player)
+ playPass(self)
+ undo(self)
}
@enduml
diff --git a/doc/diagrams/GameTree.pumlc b/doc/diagrams/GameTree.pumlc
index 85859d8..10b9251 100644
--- a/doc/diagrams/GameTree.pumlc
+++ b/doc/diagrams/GameTree.pumlc
@@ -1,8 +1,8 @@
@startuml
class GameTree {
- GameNode[] firstMoves
- GameData gameData
+ GameMove[] firstMoves
+ 'GameData gameData
}
@enduml
diff --git a/doc/diagrams/gameRepresentation.puml b/doc/diagrams/gameRepresentation.puml
index 9a869f1..db5d5a5 100644
--- a/doc/diagrams/gameRepresentation.puml
+++ b/doc/diagrams/gameRepresentation.puml
@@ -5,10 +5,13 @@
!include GameState.pumlc
!include GameTree.pumlc
!include GameMove.pumlc
+!include GameBoard.pumlc
-GameState --> GameTree
-GameState --> GameMove: Current move
+GameState -> GameTree
+GameState --> GameMove: Last move
GameTree *--> GameMove
-GameMove -> GameMove
+GameMove --> GameMove: Previous move
+GameMove *--> GameMove: Next moves
+GameBoard <- GameMove
@enduml
diff --git a/doc/diagrams/gtpEngine.puml b/doc/diagrams/gtpEngine.puml
index c4caf32..5b098da 100644
--- a/doc/diagrams/gtpEngine.puml
+++ b/doc/diagrams/gtpEngine.puml
@@ -2,13 +2,20 @@
!include skinparams.puml
-class EngineCore {
-}
-
class IO {
processComand()
}
+class EngineCore {
+ setBoardsize()
+ clearBoard()
+ setKomi()
+ setFixedHandicap()
+ play()
+ genmove()
+ undo()
+}
+
!include GameState.pumlc
'class EngineBoard {
@@ -22,7 +29,7 @@ class EngineAI {
genmove(board)
}
-EngineCore --> IO
+IO --> EngineCore
EngineCore --> GameState
EngineCore --> EngineAI