Skip to content
Snippets Groups Projects
Commit c74b6fb8 authored by Magnus Strømseng's avatar Magnus Strømseng
Browse files

update pumls

parent b4378284
Branches
No related tags found
No related merge requests found
Pipeline #275499 passed
@startuml control sequence @startuml control sequence
actor Player actor Player
participant InGameView
participant InGameController
participant Game participant Game
participant Board
participant Square
participant Piece
participant SoundStateManager
?-> Game : switchPlayer() ?-> Game : switchPlayer()
note right: Player's turn note right: Player's turn
== Player's turn == == Player's turn ==
Player-> InGameView : Move Piece Player -> InGameView : Click on a piece
activate InGameView
InGameView -> InGameController : getBoard()
InGameController -> Game : getBoard()
Game -> InGameController : board
InGameController -> InGameView : board
InGameView -> Board : getSquare()
Board -> InGameView : Square
note left: Get the valid moves for the clicked piece
InGameView -> Square : getPiece()
Square -> InGameView : Piece
InGameView -> Piece : getValidMoves()
Piece -> InGameView : List<Position>
deactivate InGameView
InGameView -> InGameController : Move Piece Player-> InGameView : Click on a target square to move to
InGameView -> InGameController : MovePiece()
InGameController -> Game : movePiece() InGameController -> Game : movePiece()
activate Game activate Game
Game -> Board : movePiece() Game -> Board : movePiece()
Board -> Square : removePiece()
Board -> Square : setPiece()
Board -> Game : update()
Board -> Game : Boolean : whether move is valid or not
Game -> Game : moves.add() Game -> Game : moves.add()
Game -> SoundStateManager : playSound()
Board -> Game : update()
Game -> SoundStateManager : playSound()
Game -> Game : updateGameStatus() Game -> Game : updateGameStatus()
Game -> Game : switchPlayer() Game -> Game : switchPlayer()
deactivate Game deactivate Game
......
...@@ -204,13 +204,14 @@ com.mygdx.game.model.Piece *-- com.mygdx.game.model.ChessPieceColor ...@@ -204,13 +204,14 @@ com.mygdx.game.model.Piece *-- com.mygdx.game.model.ChessPieceColor
Game *-- com.mygdx.game.model.GameStatus Game *-- com.mygdx.game.model.GameStatus
Square *-- Position Square *-- Position
Player *-- ChessPieceColor Player *-- ChessPieceColor
Board *-- Square : has many Board *-- "N" Square : has many
Game *-- Move : has many Game *-- "0..N" Move : has many
Game *-- Board Game *-- "1" Board
Piece *-- IMoveStrategy Piece *-- IMoveStrategy
Game *-- "2" Player : has two Game *-- "2" Player
Player *-- Loadout Player *-- Loadout
Loadout *-- Piece : has many Loadout *-- Piece : has many
Square *-- "0..1" Piece
EloCalculator -- GameEndState : takes in 1 EloCalculator -- GameEndState : takes in 1
EloCalculator -- Player : takes in 2 EloCalculator -- Player : takes in 2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment