Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Chess2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sander Skogh Linnerud
Chess2
Commits
f66f9294
Commit
f66f9294
authored
1 year ago
by
Magnus Strømseng
Browse files
Options
Downloads
Patches
Plain Diff
add generated model puml
parent
92c37b08
No related branches found
No related tags found
No related merge requests found
Pipeline
#275488
passed
1 year ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
puml/generated/model.puml
+217
-0
217 additions, 0 deletions
puml/generated/model.puml
with
217 additions
and
0 deletions
puml/generated/model.puml
0 → 100644
+
217
−
0
View file @
f66f9294
@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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment