2024-12-11 09:53:12 +01:00
|
|
|
@startuml game
|
|
|
|
!theme plain
|
|
|
|
top to bottom direction
|
|
|
|
skinparam linetype ortho
|
|
|
|
|
|
|
|
class Board {
|
|
|
|
- offsetX: int
|
|
|
|
- random: Random
|
|
|
|
- zoomFactor: double
|
|
|
|
- game: Game
|
|
|
|
- nextTile: Tile
|
|
|
|
- offsetY: int
|
|
|
|
- controlsMenu: GameControlsMenu
|
|
|
|
+ handleSpaceKeyPress(): void
|
|
|
|
+ zoomIn(): void
|
|
|
|
+ moveBoard(int, int): void
|
|
|
|
+ zoomOut(): void
|
|
|
|
- initializeNextTile(): void
|
|
|
|
- calculateAvailablePositions(Tile): void
|
|
|
|
+ handleMouseMove(MouseEvent): void
|
|
|
|
- isTileAtPosition(Point): boolean
|
|
|
|
+ handleMouseClick(MouseEvent): void
|
|
|
|
+ paintComponent(Graphics): void
|
|
|
|
+ autoReFocus(Tile): void
|
|
|
|
+ getTileAt(int, int): Tile
|
|
|
|
- initializeCentralTile(): void
|
|
|
|
+ placeTileAtPosition(Point): void
|
|
|
|
+ addTile(Tile): void
|
|
|
|
random: Random
|
|
|
|
zoomFactor: double
|
|
|
|
controlsMenu: GameControlsMenu
|
|
|
|
nextTile: Tile
|
|
|
|
offsetX: int
|
|
|
|
game: Game
|
|
|
|
offsetY: int
|
2024-12-11 09:13:00 +01:00
|
|
|
}
|
2024-12-11 09:53:12 +01:00
|
|
|
class Cell {
|
|
|
|
+ radius: int
|
|
|
|
- board: Board
|
|
|
|
+ setPosition(int, int): void
|
|
|
|
# paintComponent(Graphics): void
|
|
|
|
+ to360Degrees(double): double
|
|
|
|
XCoord: int
|
|
|
|
board: Board
|
|
|
|
YCoord: int
|
|
|
|
radius: int
|
2024-12-11 09:13:00 +01:00
|
|
|
}
|
2024-12-11 09:53:12 +01:00
|
|
|
class CustomKeyAdapter {
|
|
|
|
+ keyPressed(KeyEvent): void
|
2024-12-11 09:13:00 +01:00
|
|
|
}
|
2024-12-11 09:53:12 +01:00
|
|
|
class CustomMouseMotionAdapter {
|
|
|
|
+ mouseMoved(MouseEvent): void
|
2024-12-11 09:13:00 +01:00
|
|
|
}
|
2024-12-11 09:53:12 +01:00
|
|
|
class EscapeMenu {
|
|
|
|
- createButton(String): JButton
|
|
|
|
menuVisible: boolean
|
|
|
|
settingsButtonListener: ActionListener
|
|
|
|
resumeButtonListener: ActionListener
|
|
|
|
quitButtonListener: ActionListener
|
2024-12-11 09:13:00 +01:00
|
|
|
}
|
2024-12-11 09:53:12 +01:00
|
|
|
class Game {
|
|
|
|
+ getRandomInt(int): int
|
2024-12-11 09:13:00 +01:00
|
|
|
}
|
2024-12-11 09:53:12 +01:00
|
|
|
class PauseGame {
|
|
|
|
+ keyPressed(KeyEvent): void
|
2024-12-11 09:13:00 +01:00
|
|
|
}
|
2024-12-11 09:53:12 +01:00
|
|
|
class Pocket {
|
|
|
|
- biome: Biome
|
|
|
|
- tiles: Set<Tile>
|
|
|
|
+ addTile(Tile): void
|
|
|
|
tiles: Set<Tile>
|
|
|
|
size: int
|
|
|
|
biome: Biome
|
2024-12-11 09:13:00 +01:00
|
|
|
}
|
2024-12-11 09:53:12 +01:00
|
|
|
class RemainingTilesIndicator {
|
|
|
|
- remainingTiles: int
|
|
|
|
+ draw(Graphics, int, int): void
|
|
|
|
- createHexagon(int, int, int, int): Polygon
|
|
|
|
totalHeight: int
|
|
|
|
remainingTiles: int
|
2024-12-11 09:13:00 +01:00
|
|
|
}
|
2024-12-11 09:53:12 +01:00
|
|
|
class ScoreDisplay {
|
|
|
|
- score: int
|
|
|
|
+ setPosition(int, int): void
|
|
|
|
+ draw(Graphics): void
|
|
|
|
score: int
|
2024-12-11 09:13:00 +01:00
|
|
|
}
|
2024-12-11 09:53:12 +01:00
|
|
|
class ScoreManager {
|
|
|
|
- currentScore: int
|
|
|
|
- recalculateScore(): void
|
|
|
|
- findPocketForTile(Tile, Biome): Pocket?
|
|
|
|
+ addTile(Tile): void
|
|
|
|
currentScore: int
|
2024-12-11 09:13:00 +01:00
|
|
|
}
|
2024-12-11 09:53:12 +01:00
|
|
|
class Tile {
|
|
|
|
+ determineSide(int, int): TileOrientation
|
|
|
|
+ getBiome(TileOrientation): Biome
|
|
|
|
+ getNeighbor(TileOrientation): Tile
|
|
|
|
+ containsBiome(Biome): boolean
|
|
|
|
+ assignRandomBiomes(): void
|
|
|
|
# drawTileAt(Graphics, int, int, float): void
|
|
|
|
# paintTile(Graphics, float): void
|
|
|
|
+ isAdjacentTo(Tile): boolean
|
|
|
|
+ rotate(boolean): void
|
|
|
|
biomes: Biome[]
|
|
|
|
dominantBiome: Biome
|
2024-12-11 09:13:00 +01:00
|
|
|
}
|
2024-12-11 09:53:12 +01:00
|
|
|
class TilePanningTransition {
|
|
|
|
+ start(): void
|
2024-12-11 09:13:00 +01:00
|
|
|
}
|
|
|
|
|
2024-12-11 09:53:12 +01:00
|
|
|
Board -[#595959,dashed]-> CustomKeyAdapter : "«create»"
|
|
|
|
Board -[#595959,dashed]-> CustomMouseMotionAdapter : "«create»"
|
|
|
|
Board "1" *-[#595959,plain]-> "game\n1" Game
|
|
|
|
Board -[#595959,dashed]-> Game : "«create»"
|
|
|
|
Board -[#595959,dashed]-> PauseGame : "«create»"
|
|
|
|
Board -[#595959,dashed]-> RemainingTilesIndicator : "«create»"
|
|
|
|
Board "1" *-[#595959,plain]-> "remainingTilesIndicator\n1" RemainingTilesIndicator
|
|
|
|
Board -[#595959,dashed]-> ScoreDisplay : "«create»"
|
|
|
|
Board "1" *-[#595959,plain]-> "scoreDisplay\n1" ScoreDisplay
|
|
|
|
Board -[#595959,dashed]-> ScoreManager : "«create»"
|
|
|
|
Board "1" *-[#595959,plain]-> "scoreManager\n1" ScoreManager
|
|
|
|
Board "1" *-[#595959,plain]-> "tiles\n*" Tile
|
|
|
|
Board -[#595959,dashed]-> Tile : "«create»"
|
|
|
|
Board -[#595959,dashed]-> TilePanningTransition : "«create»"
|
|
|
|
Cell "1" *-[#595959,plain]-> "board\n1" Board
|
|
|
|
CustomKeyAdapter "1" *-[#595959,plain]-> "board\n1" Board
|
|
|
|
CustomMouseMotionAdapter "1" *-[#595959,plain]-> "board\n1" Board
|
|
|
|
PauseGame "1" *-[#595959,plain]-> "escapeMenu\n1" EscapeMenu
|
|
|
|
PauseGame -[#595959,dashed]-> EscapeMenu : "«create»"
|
|
|
|
Pocket "1" *-[#595959,plain]-> "tiles\n*" Tile
|
|
|
|
ScoreManager -[#595959,dashed]-> Pocket : "«create»"
|
|
|
|
ScoreManager "1" *-[#595959,plain]-> "pockets\n*" Pocket
|
|
|
|
Tile -[#000082,plain]-^ Cell
|
|
|
|
TilePanningTransition "1" *-[#595959,plain]-> "board\n1" Board
|
2024-12-11 09:13:00 +01:00
|
|
|
@enduml
|