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

add default diagrams

parent 4e465f19
No related branches found
No related tags found
No related merge requests found
Pipeline #275481 passed
@startuml
class com.mygdx.game.ChessGame {
+ {static} float WIDTH
+ {static} float HEIGHT
~ APIClientProvider apiProvider
+ void create()
+ void render()
+ void dispose()
+ void resize(int,int)
}
com.badlogic.gdx.ApplicationAdapter <|-- com.mygdx.game.ChessGame
@enduml
\ No newline at end of file
@startuml
class com.mygdx.game.controller.InGameController {
+ boolean touchDown(int,int,int,int)
+ {static} GameStatus getGameStatus()
+ {static} void setEndGameState()
+ {static} Boolean isColorsTurn(Piece.ChessPieceColor)
+ {static} Board getBoard()
+ {static} void MovePiece(Piece,Square)
+ {static} void forfeitGame()
+ {static} void SetSquareHighlight(Position,Boolean)
}
class com.mygdx.game.controller.LeaderboardController {
- {static} EntityService entityService
- void initLeaderboard()
- void getPlayersForLeaderboard(FirestoreCallback<List<UserProfileData>>)
+ {static} void returnToMenu()
}
class com.mygdx.game.controller.EndGameController {
- {static} EntityService entityService
+ void concludeGame()
- void updateUserProfile(String,Integer)
+ {static} Player getLoser()
+ {static} Player getWinner()
+ {static} void returnToMainMenu()
}
class com.mygdx.game.controller.MainMenuController {
+ {static} void mainMenu()
+ {static} void startGameLobby()
+ {static} void menuSettings()
+ {static} void menuLeaderboard()
+ {static} void menuHowToPlay()
}
class com.mygdx.game.controller.ControllerStateManager {
- Stack<ControllerState> controller
+ void push(ControllerState)
+ void pop()
+ void set(ControllerState)
+ ControllerState peek()
+ int size()
}
class com.mygdx.game.controller.SettingsController {
+ {static} void toggleMusic()
+ {static} void toggleSoundEffects()
+ {static} boolean isMusicMuted()
+ {static} boolean isSoundMuted()
}
class com.mygdx.game.controller.Configuration {
+ ArrayList<Integer> boardSizes
+ ArrayList<Integer> timeLimits
}
class com.mygdx.game.controller.GameLobbyController {
- {static} EntityService entityService
- {static} GameSessionData gameSessionData
- {static} ArrayList<String> loadouts
- {static} ArrayList<Integer> boardSizes
- {static} ArrayList<Integer> timeLimits
- {static} void loadConfigurations()
- {static} void loadLoadouts()
+ {static} ArrayList<Integer> getBoardSizes()
+ {static} ArrayList<Integer> getTimeLimits()
+ {static} ArrayList<String> getLoadouts()
+ {static} boolean startGame(ArrayList<Player>,int,int,List<String>)
+ {static} void createGameSession(List<Player>,int,int)
- {static} void createGameState(List<UserProfileData>)
- {static} List<UserProfileData> convertPlayersToUserProfileData(List<Player>)
}
abstract class com.mygdx.game.controller.ControllerState {
- ControllerStateManager controllerStateManager
+ ControllerStateManager getControllerStateManager()
+ void setControllerStateManager(ControllerStateManager)
+ {static} void returnToMainMenu()
}
class com.mygdx.game.controller.HowToPlayController {
- {static} int currentPage
- {static} int maxPages
+ {static} void returnToMenu()
+ {static} int getCurrentPage()
+ {static} void nextPage()
+ {static} void previousPage()
+ {static} int getMaxPages()
+ {static} void reset()
}
class com.mygdx.game.controller.SoundManager {
- {static} SoundManager instance
- {static} AssetManager assetManager
- Music currentMusic
- Map<String,String> soundPaths
- Map<String,Sound> soundEffects
- Map<String,Music> musicTracks
- boolean isMusicMuted
- boolean isSoundMuted
- Preferences prefs
- float musicVolume
- void loadPreferences()
- void initializeSounds()
+ void loadAssets()
+ {static} SoundManager getInstance(AssetManager)
+ {static} SoundManager getInstance()
+ void playSound(String)
+ void playMusic(String)
+ void toggleMusicMute()
+ void toggleSoundMute()
+ boolean isMusicMuted()
+ boolean isSoundMuted()
+ void dispose()
}
com.mygdx.game.controller.ControllerState <|-- com.mygdx.game.controller.InGameController
com.mygdx.game.controller.ControllerState <|-- com.mygdx.game.controller.LeaderboardController
com.mygdx.game.controller.ControllerState <|-- com.mygdx.game.controller.EndGameController
com.mygdx.game.controller.ControllerState <|-- com.mygdx.game.controller.MainMenuController
com.mygdx.game.controller.ControllerState <|-- com.mygdx.game.controller.SettingsController
com.mygdx.game.controller.ControllerState <|-- com.mygdx.game.controller.GameLobbyController
com.badlogic.gdx.InputAdapter <|-- com.mygdx.game.controller.ControllerState
com.mygdx.game.controller.ControllerState <|-- com.mygdx.game.controller.HowToPlayController
com.badlogic.gdx.utils.Disposable <|.. com.mygdx.game.controller.SoundManager
@enduml
\ No newline at end of file
@startuml
class com.mygdx.game.GameManager {
- {static} APIClientProvider apiClientProvider
- EntityService service
- List<Player> players
- ViewStateManager viewStateManager
- ControllerStateManager controllerStateManager
- {static} GameManager instance
+ void dispose()
+ void setApiClientProvider(APIClientProvider)
+ EntityService getEntityService()
+ {static} GameManager getInstance()
+ void setStateManagers(GameState)
- void setState(ViewState,ControllerState)
+ void popStates()
+ void render()
+ ViewStateManager getViewStateManager()
+ ControllerStateManager getControllerStateManager()
+ void resize(int,int)
+ void setPlayers(List<Player>)
+ List<Player> getPlayers()
+ Player findPlayerByName(String)
+ {static} void initializePlayerData()
}
enum com.mygdx.game.GameState {
+ MAIN_MENU
+ IN_GAME
+ SETTINGS
+ GAME_LOBBY
+ HOW_TO_PLAY
+ LEADERBOARD
+ END_GAME
}
@enduml
\ No newline at end of file
@startuml
class com.mygdx.game.model.moves.KnightMoveStrategy {
+ List<Position> calculateValidMoves(Piece)
}
class com.mygdx.game.model.moves.RookMoveStrategy {
+ List<Position> calculateValidMoves(Piece)
}
class com.mygdx.game.model.moves.PawnMoveStrategy {
+ List<Position> calculateValidMoves(Piece)
}
class com.mygdx.game.model.moves.PhoenixMoveStrategy {
+ List<Position> calculateValidMoves(Piece)
}
class com.mygdx.game.model.pieces.Thief {
+ String getName()
}
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.moves.SnakeMoveStrategy {
+ List<Position> calculateValidMoves(Piece)
}
class com.mygdx.game.model.moves.BishopMoveStrategy {
+ List<Position> calculateValidMoves(Piece)
}
class com.mygdx.game.model.board.Loadout {
- Piece[][] pieces
+ String toString()
+ void printLoadoutWithHeaders()
+ Piece[][] getPieces()
+ {static} void main(String[])
}
class com.mygdx.game.model.pieces.Rook {
+ String getName()
}
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.pieces.Snake {
+ String getName()
}
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()
}
class com.mygdx.game.model.pieces.Bishop {
+ String getName()
}
interface com.mygdx.game.model.moves.IMoveStrategy {
~ List<Position> calculateValidMoves(Piece)
}
class com.mygdx.game.model.pieces.Knight {
+ String getName()
}
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.moves.ThiefMoveStrategy {
+ List<Position> calculateValidMoves(Piece)
}
class com.mygdx.game.model.moves.QueenMoveStrategy {
+ List<Position> calculateValidMoves(Piece)
}
class com.mygdx.game.model.pieces.Pawn {
+ String getName()
}
class com.mygdx.game.model.board.Square {
- int x
- int y
- 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.moves.KingMoveStrategy {
+ List<Position> calculateValidMoves(Piece)
}
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()
}
class com.mygdx.game.model.pieces.Phoenix {
+ String getName()
}
com.mygdx.game.model.moves.IMoveStrategy <|.. com.mygdx.game.model.moves.KnightMoveStrategy
com.mygdx.game.model.moves.IMoveStrategy <|.. com.mygdx.game.model.moves.RookMoveStrategy
com.mygdx.game.model.moves.IMoveStrategy <|.. com.mygdx.game.model.moves.PawnMoveStrategy
com.mygdx.game.model.moves.IMoveStrategy <|.. com.mygdx.game.model.moves.PhoenixMoveStrategy
com.mygdx.game.model.Piece <|-- com.mygdx.game.model.pieces.Thief
com.mygdx.game.model.Piece <|-- com.mygdx.game.model.pieces.King
com.mygdx.game.model.moves.IMoveStrategy <|.. com.mygdx.game.model.moves.SnakeMoveStrategy
com.mygdx.game.model.moves.IMoveStrategy <|.. com.mygdx.game.model.moves.BishopMoveStrategy
com.mygdx.game.model.Piece <|-- com.mygdx.game.model.pieces.Rook
com.mygdx.game.model.Piece <|-- com.mygdx.game.model.pieces.Snake
com.mygdx.game.model.Piece <|-- com.mygdx.game.model.pieces.Bishop
com.mygdx.game.model.Piece <|-- com.mygdx.game.model.pieces.Knight
com.mygdx.game.model.moves.IMoveStrategy <|.. com.mygdx.game.model.moves.ThiefMoveStrategy
com.mygdx.game.model.moves.IMoveStrategy <|.. com.mygdx.game.model.moves.QueenMoveStrategy
com.mygdx.game.model.Piece <|-- com.mygdx.game.model.pieces.Pawn
com.mygdx.game.model.moves.IMoveStrategy <|.. com.mygdx.game.model.moves.KingMoveStrategy
com.mygdx.game.model.Piece <|-- com.mygdx.game.model.pieces.Queen
com.mygdx.game.model.Piece <|-- com.mygdx.game.model.pieces.Phoenix
@enduml
\ No newline at end of file
@startuml
class com.mygdx.game.view.HowToPlayView {
- String[] pages
- String[] imgUrls
- Table table
- void setupUI()
- void addImg(Table)
- void addTitle(Table)
- void addDescription(Table)
- String getImgUrl()
- String getDescription()
- void addButtons(Table)
+ void resize(int,int)
+ void dispose()
+ void update()
- void updateImageAndDescription()
}
class com.mygdx.game.view.components.TitleComponent {
- Label.LabelStyle titleStyle
+ Label createTitle(String)
+ Container<Label> createDescription(String)
}
class com.mygdx.game.view.InGameView {
- Table boardTable
- Texture tileTexture1
- Texture tileTexture2
- Texture tileTexture3
- Square selectedPieceSquare
- BoundedCamera camera
- int squareSize
- Viewport viewport
- InGameHUD topHUD
- Board viewedMoveHistoryBoard
- Boolean isViewingMoveHistory
- Move selectedMove
~ float minZoom
~ float maxZoom
+ Board getViewedMoveHistoryBoard()
+ void setViewedMoveHistoryBoard(Board)
+ Move getSelectedMove()
+ void setSelectedMove(Move)
+ Boolean getViewingMoveHistory()
+ void setViewingMoveHistory(Boolean)
+ Viewport getViewport()
+ void update()
+ void render()
- void touchSquareListener(Board,int,int)
- void touchPieceListener(Board,int,int)
+ void zoom(float)
+ void pan(float,float)
}
class com.mygdx.game.view.InGameHUD {
~ OrthographicCamera camera
~ Stage stage
~ Table table
~ Label.LabelStyle labelStyle
~ Label currentPlayerLabel
~ HashMap<Player,Label> playerTimeLabels
~ TextButton pauseButton
~ boolean isTimerPaused
~ ArrayList<Move> moves
~ InGameView inGameView
- void addPauseButton()
+ void initializePlayerLabels()
- void updatePlayerTimeLabels()
+ Stage getStage()
+ void apply()
+ OrthographicCamera getCamera()
+ void render()
+ void update()
}
enum com.mygdx.game.view.HUDPosition {
+ TOP
+ BOTTOM
}
class com.mygdx.game.view.ViewStateManager {
- Stack<ViewState> views
+ void push(ViewState)
+ void pop()
+ void set(ViewState)
+ void render()
+ void update()
+ void dispose()
+ int size()
+ void resize(int,int)
}
class com.mygdx.game.view.EndGameView {
+ void update()
}
abstract class com.mygdx.game.view.ViewState {
# ViewStateManager viewStateManager
# OrthographicCamera camera
# SpriteBatch batch
# Stage stage
# TextureAtlas atlas
# TextureAtlas.AtlasRegion buttonTexture
# Label.LabelStyle labelStyle
# ButtonComponent buttonComponent
# CheckboxComponent checkboxComponent
# TextInputComponent textInputComponent
# TitleComponent titleComponent
# SelectComponent selectComponent
# {static} TextComponent textComponent
- {static} float DESIGN_WIDTH
# {static} float scaleFactor
# Skin skin
+ {static} float getScaleFactor()
+ {static} int getScaledLength(int)
# void setupStage()
+ void render()
# void createBackButton(Runnable)
+ {abstract}void update()
+ void dispose()
# InputListener createButtonListener(Runnable)
# void resize(int,int)
}
class com.mygdx.game.view.FontCollection {
- {static} FontCollection instance
- {static} HashMap<Integer,BitmapFont> fonts
- {static} void checkExistenceCreateIfNot()
+ {static} BitmapFont getFont(int)
+ void dispose()
}
class com.mygdx.game.view.BoundedCamera {
~ BoundingBox left
~ BoundingBox full
~ Vector3 lastPosition
+ void setWorldBounds(int,int,int,int)
+ void translate(float,float)
+ void translateSafe(float,float)
+ void ensureBounds()
}
class com.mygdx.game.view.MainMenuView {
- void setupUI()
- void addLogo(Table)
- void addTitle(Table)
- void addButtonComponents(Table)
+ void resize(int,int)
+ void dispose()
+ void update()
}
class com.mygdx.game.view.components.TextComponent {
- Label.LabelStyle titleStyle
+ Label createTitle(String)
}
class com.mygdx.game.view.components.SelectComponent {
- Skin skin
+ SelectBox<String> createSelectBox(String)
+ String getSelectedValue(SelectBox<String>)
}
class com.mygdx.game.view.components.CheckboxComponent {
- CheckBox.CheckBoxStyle checkBoxStyle
+ CheckBox createCheckbox(String,boolean,InputListener)
}
class com.mygdx.game.view.SettingsView {
- void setupUI()
- void addLogo(Table)
- void addTitle(Table)
- void addSettingsComponents(Table)
+ void dispose()
+ void update()
}
class com.mygdx.game.view.components.TextInputComponent {
- Skin skin
+ TextField createTextField(String,ChangeListener)
+ String getTextValue(TextField)
}
class com.mygdx.game.view.GameLobbyView {
- TextField player1NameField
- SelectBox<String> timePerMoveSelect
- Label errorMessage
- void setupUI()
- Label createLabel(String)
- SelectBox<String> createSelectBox(String,String[],Table)
- TextField createTextField(String,Table)
- TextButton createStartGameButton()
+ void update()
}
class com.mygdx.game.view.components.ButtonComponent {
- {static} int WIDTH
- {static} int HEIGHT
- {static} int BORDER_RADIUS
- {static} int FONT_SIZE
- TextButton.TextButtonStyle defaultButtonStyle
- TextButton.TextButtonStyle greenButtonStyle
- void initStyles()
- Drawable createDrawable(Color)
- TextButton.TextButtonStyle createButtonStyle(Color,Color,Color)
- TextButton createButton(String,TextButton.TextButtonStyle,InputListener)
+ TextButton createDefaultButton(String,InputListener)
+ TextButton createGreenButton(String,InputListener)
}
class com.mygdx.game.view.LeaderboardView {
- {static} Table leaderboardTable
- {static} Label loadingLabel
- void setupUI()
- void addTitle(Table)
+ {static} void updateLeaderboard(List<UserProfileData>)
- {static} void addLeaderboardHeaders()
- {static} void addLeaderboardRow(String[])
+ void dispose()
+ void update()
}
class com.mygdx.game.view.gestureListeners.InGameGestureListener {
- InGameView inGameView
+ boolean touchDown(float,float,int,int)
+ boolean tap(float,float,int,int)
+ boolean longPress(float,float)
+ boolean fling(float,float,int)
+ boolean pan(float,float,float,float)
+ boolean panStop(float,float,int,int)
+ boolean zoom(float,float)
+ boolean pinch(Vector2,Vector2,Vector2,Vector2)
+ void pinchStop()
}
com.mygdx.game.view.ViewState <|-- com.mygdx.game.view.HowToPlayView
com.mygdx.game.view.ViewState <|-- com.mygdx.game.view.InGameView
com.mygdx.game.view.ViewState <|-- com.mygdx.game.view.EndGameView
com.badlogic.gdx.graphics.OrthographicCamera <|-- com.mygdx.game.view.BoundedCamera
com.mygdx.game.view.ViewState <|-- com.mygdx.game.view.MainMenuView
com.mygdx.game.view.ViewState <|-- com.mygdx.game.view.SettingsView
com.mygdx.game.view.ViewState <|-- com.mygdx.game.view.GameLobbyView
com.mygdx.game.view.ViewState <|-- com.mygdx.game.view.LeaderboardView
com.mygdx.game.view.gestureListeners.GestureListener <|.. com.mygdx.game.view.gestureListeners.InGameGestureListener
@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