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

add generated model puml

parent 92c37b08
No related branches found
No related tags found
No related merge requests found
Pipeline #275488 passed
@startuml
class com.mygdx.game.model.pieces.King {
+ String getName()
}
class com.mygdx.game.model.ChessPieceFactory {
+ {static} Piece createPiece(String,ChessPieceColor,Board)
+ {static} Piece createPiece(Piece)
}
class com.mygdx.game.model.Position {
- int x
- int y
+ int getX()
+ int getY()
+ boolean equals(Position)
+ boolean equals(Object)
+ String toString()
}
class com.mygdx.game.model.player.Loadout {
- Piece[][] pieces
+ String toString()
+ void printLoadoutWithHeaders()
+ Piece[][] getPieces()
+ {static} void main(String[])
}
class com.mygdx.game.model.player.EloCalculator {
~ {static} int K
~ {static} int K2
- {static} float ExpectedScore(float,float)
+ {static} ArrayList<Integer> Calculate2Player(float,float,GameEndState)
+ {static} void main(String[])
}
enum com.mygdx.game.model.player.GameEndState {
+ WIN
+ LOSE
+ DRAW
}
enum com.mygdx.game.model.GameStatus {
+ ACTIVE
+ CHECKMATE
+ STALEMATE
}
class com.mygdx.game.model.player.Player {
- String name
- int time
- Loadout loadout
- Long elo
- Piece.ChessPieceColor color
+ Piece.ChessPieceColor getColor()
+ void setColor(Piece.ChessPieceColor)
+ String getName()
+ Long getElo()
+ void setElo(Long)
+ boolean decreaseTime()
+ void setTime(int)
+ String getRemainingTimeString()
}
interface com.mygdx.game.model.moves.IMoveStrategy {
~ List<Position> calculateValidMoves(Piece)
}
class com.mygdx.game.model.board.Move {
- Position fromPosition
- Position toPosition
- Piece pieceMoved
- Piece pieceCaptured
- Board boardState
+ String toString()
+ Board getBoardState()
+ Position getFromPosition()
+ Position getToPosition()
}
class com.mygdx.game.model.Game {
- {static} Game instance
- Player currentPlayer
- List<Player> players
- int mapSize
- int time
- GameStatus gameStatus
- ArrayList<Move> moves
- int currentPlayerIndex
- Board board
- List<King> kings
- Player winner
- Player loser
- Timer timer
+ {static} Game getInstance()
+ List<Player> getPlayers()
+ Player getCurrentPlayer()
+ void startGame(List<Player>,int,int,List<String>)
+ void endGame()
+ void switchPlayer()
+ void togglePause(boolean)
- void setPlayerColors(List<Player>)
- void updateGameStatus(GameStatus)
+ List<King> getKings()
+ GameStatus getGameStatus()
+ void update()
+ void movePiece(Piece,Square)
+ void setCheckmate()
+ Player getWinner()
+ Player getLoser()
+ Boolean isColorsTurn(Piece.ChessPieceColor)
+ Board getBoard()
+ void addKing(King)
+ Boolean isCheckMate(King)
+ List<Position> getNonCheckedMoves(Piece,List<Position>)
+ Boolean isKingInCheckOnMove(Piece,Position)
- void startTimer(int,int)
- void setPlayerTimes(List<Player>)
+ Boolean isKingInCheck(Piece)
+ Boolean attacksKing(List<Position>,Piece)
+ ArrayList<Move> getMoves()
}
abstract class com.mygdx.game.model.Piece {
- ChessPieceColor color
- Square square
- Image image
- List<Position> validMoves
- Board board
- IMoveStrategy moveStrategy
+ Board getBoard()
+ String toString()
+ {abstract}String getName()
+ ChessPieceColor getColor()
+ Position getPosition()
+ void setSquare(Square)
+ Square getSquare()
+ List<Position> getValidMoves()
+ Image getImage()
+ List<Position> getRepeatingMoves(int[][])
+ List<Position> getNonReapetingMoves(int[][])
# boolean isTargetSameColor(Position)
}
enum com.mygdx.game.model.ChessPieceColor {
+ WHITE
+ BLACK
}
class com.mygdx.game.model.pieces.Pawn {
+ String getName()
}
class com.mygdx.game.model.board.Square {
- Position position
- Piece piece
- boolean isOccupied
- Boolean isHighlighted
+ boolean isOccupied()
+ boolean isOccupiedByPiece()
+ void setPiece(Piece)
+ void removePiece()
+ void setOccupied(boolean)
+ Piece getPiece()
+ int getX()
+ int getY()
+ Position getPosition()
+ void setIsHighlighted(Boolean)
+ Boolean getIsHighlighted()
- String getPieceNameIfNotNull()
+ String toString()
+ Boolean equals(Square)
}
class com.mygdx.game.model.board.Board {
- int width
- int height
- Square[][] squares
+ void setUpLoadouts(Loadout,Loadout)
+ int getWidth()
+ int getHeight()
+ Square getSquare(int,int)
+ Square[][] getSquares()
+ Boolean movePiece(Position,Position)
+ String toString()
}
class com.mygdx.game.model.pieces.Queen {
+ String getName()
}
com.mygdx.game.model.Piece <|-- com.mygdx.game.model.pieces.King
com.mygdx.game.model.Piece <|-- com.mygdx.game.model.pieces.Pawn
com.mygdx.game.model.Piece <|-- com.mygdx.game.model.pieces.Queen
ChessPieceFactory -- com.mygdx.game.model.Piece : Creates >
com.mygdx.game.model.Piece *-- com.mygdx.game.model.ChessPieceColor
Game *-- com.mygdx.game.model.GameStatus
Square *-- Position
Player *-- ChessPieceColor
Board *-- Square : has many
Game *-- Move : has many
Game *-- Board
Piece *-- IMoveStrategy
Game *-- "2" Player : has two
Player *-- Loadout
Loadout *-- Piece : has many
EloCalculator -- GameEndState : takes in 1
EloCalculator -- Player : takes in 2
@enduml
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment