Ajouts des bons diagrammes de classe
This commit is contained in:
@@ -1,193 +1,136 @@
|
||||
@startuml
|
||||
class fr.monkhanny.dorfromantik.game.CustomKeyAdapter {
|
||||
- Board board
|
||||
+ <<Create>> CustomKeyAdapter(Board)
|
||||
+ void keyPressed(KeyEvent)
|
||||
@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
|
||||
}
|
||||
class Cell {
|
||||
+ radius: int
|
||||
- board: Board
|
||||
+ setPosition(int, int): void
|
||||
# paintComponent(Graphics): void
|
||||
+ to360Degrees(double): double
|
||||
XCoord: int
|
||||
board: Board
|
||||
YCoord: int
|
||||
radius: int
|
||||
}
|
||||
class CustomKeyAdapter {
|
||||
+ keyPressed(KeyEvent): void
|
||||
}
|
||||
class CustomMouseMotionAdapter {
|
||||
+ mouseMoved(MouseEvent): void
|
||||
}
|
||||
class EscapeMenu {
|
||||
- createButton(String): JButton
|
||||
menuVisible: boolean
|
||||
settingsButtonListener: ActionListener
|
||||
resumeButtonListener: ActionListener
|
||||
quitButtonListener: ActionListener
|
||||
}
|
||||
class Game {
|
||||
+ getRandomInt(int): int
|
||||
}
|
||||
class PauseGame {
|
||||
+ keyPressed(KeyEvent): void
|
||||
}
|
||||
class Pocket {
|
||||
- biome: Biome
|
||||
- tiles: Set<Tile>
|
||||
+ addTile(Tile): void
|
||||
tiles: Set<Tile>
|
||||
size: int
|
||||
biome: Biome
|
||||
}
|
||||
class RemainingTilesIndicator {
|
||||
- remainingTiles: int
|
||||
+ draw(Graphics, int, int): void
|
||||
- createHexagon(int, int, int, int): Polygon
|
||||
totalHeight: int
|
||||
remainingTiles: int
|
||||
}
|
||||
class ScoreDisplay {
|
||||
- score: int
|
||||
+ setPosition(int, int): void
|
||||
+ draw(Graphics): void
|
||||
score: int
|
||||
}
|
||||
class ScoreManager {
|
||||
- currentScore: int
|
||||
- recalculateScore(): void
|
||||
- findPocketForTile(Tile, Biome): Pocket?
|
||||
+ addTile(Tile): void
|
||||
currentScore: int
|
||||
}
|
||||
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
|
||||
}
|
||||
class TilePanningTransition {
|
||||
+ start(): void
|
||||
}
|
||||
|
||||
|
||||
class fr.monkhanny.dorfromantik.game.ScoreManager {
|
||||
- List<Pocket> pockets
|
||||
- int currentScore
|
||||
+ <<Create>> ScoreManager()
|
||||
+ void addTile(Tile)
|
||||
- Pocket findPocketForTile(Tile,Biome)
|
||||
- void recalculateScore()
|
||||
+ int getCurrentScore()
|
||||
}
|
||||
|
||||
|
||||
class fr.monkhanny.dorfromantik.game.EscapeMenu {
|
||||
- JButton resumeButton
|
||||
- JButton mainMenuButton
|
||||
- JButton settingsButton
|
||||
+ <<Create>> EscapeMenu(JFrame,Game)
|
||||
- JButton createButton(String)
|
||||
+ void setResumeButtonListener(ActionListener)
|
||||
+ void setQuitButtonListener(ActionListener)
|
||||
+ void setSettingsButtonListener(ActionListener)
|
||||
+ void setMenuVisible(boolean)
|
||||
}
|
||||
|
||||
|
||||
class fr.monkhanny.dorfromantik.game.Cell {
|
||||
- Board board
|
||||
+ int x
|
||||
+ int y
|
||||
+ int radius
|
||||
+ <<Create>> Cell(Board,int,int,int)
|
||||
+ Board getBoard()
|
||||
+ int getXCoord()
|
||||
+ int getYCoord()
|
||||
+ int getRadius()
|
||||
+ {static} double to360Degrees(double)
|
||||
+ void setPosition(int,int)
|
||||
# void paintComponent(Graphics)
|
||||
}
|
||||
|
||||
|
||||
class fr.monkhanny.dorfromantik.game.Game {
|
||||
- Random random
|
||||
+ <<Create>> Game(long)
|
||||
+ <<Create>> Game()
|
||||
+ int getRandomInt(int)
|
||||
}
|
||||
|
||||
|
||||
class fr.monkhanny.dorfromantik.game.TilePanningTransition {
|
||||
- Board board
|
||||
- int targetOffsetX
|
||||
- int steps
|
||||
+ <<Create>> TilePanningTransition(Board,int,int,int)
|
||||
+ void start()
|
||||
}
|
||||
|
||||
|
||||
class fr.monkhanny.dorfromantik.game.RemainingTilesIndicator {
|
||||
- int remainingTiles
|
||||
- int maxTiles
|
||||
+ <<Create>> RemainingTilesIndicator(int)
|
||||
+ void setRemainingTiles(int)
|
||||
+ void draw(Graphics,int,int)
|
||||
+ int getTotalHeight()
|
||||
- Polygon createHexagon(int,int,int,int)
|
||||
}
|
||||
|
||||
|
||||
class fr.monkhanny.dorfromantik.game.CustomMouseMotionAdapter {
|
||||
- Board board
|
||||
+ <<Create>> CustomMouseMotionAdapter(Board)
|
||||
+ void mouseMoved(MouseEvent)
|
||||
}
|
||||
|
||||
|
||||
class fr.monkhanny.dorfromantik.game.Tile {
|
||||
- HashMap<TileOrientation,Biome> sideBiomes
|
||||
+ <<Create>> Tile(Board,int,int,int,Biome)
|
||||
+ <<Create>> Tile(Board,int,int,int)
|
||||
+ <<Create>> Tile(Board,Point,int,Biome)
|
||||
+ <<Create>> Tile(Board,Point,int)
|
||||
+ void setBiomes(Biome)
|
||||
+ void assignRandomBiomes()
|
||||
+ Biome getBiome(TileOrientation)
|
||||
+ Biome getDominantBiome()
|
||||
+ Biome[] getBiomes()
|
||||
+ void rotate(boolean)
|
||||
+ boolean containsBiome(Biome)
|
||||
+ boolean isAdjacentTo(Tile)
|
||||
+ Tile getNeighbor(TileOrientation)
|
||||
+ TileOrientation determineSide(int,int)
|
||||
# void drawTileAt(Graphics,int,int,float)
|
||||
# void paintTile(Graphics,float)
|
||||
}
|
||||
|
||||
|
||||
class fr.monkhanny.dorfromantik.game.ScoreDisplay {
|
||||
- int score
|
||||
- Font font
|
||||
- int x
|
||||
+ <<Create>> ScoreDisplay(Font,int,int)
|
||||
+ void setScore(int)
|
||||
+ void setPosition(int,int)
|
||||
+ void draw(Graphics)
|
||||
}
|
||||
|
||||
|
||||
class fr.monkhanny.dorfromantik.game.Pocket {
|
||||
- Biome biome
|
||||
- Set<Tile> tiles
|
||||
+ <<Create>> Pocket(Biome)
|
||||
+ void addTile(Tile)
|
||||
+ int getSize()
|
||||
+ Biome getBiome()
|
||||
+ Set<Tile> getTiles()
|
||||
}
|
||||
|
||||
|
||||
class fr.monkhanny.dorfromantik.game.Board {
|
||||
- List<Tile> tiles
|
||||
- List<Point> availablePositions
|
||||
- Random random
|
||||
- Game game
|
||||
- JFrame gameFrame
|
||||
- Tile centralTile
|
||||
- double zoomFactor
|
||||
- int offsetX
|
||||
- int offsetY
|
||||
- Tile nextTile
|
||||
- Point mousePosition
|
||||
- int currentScore
|
||||
- Database database
|
||||
- RemainingTilesIndicator remainingTilesIndicator
|
||||
- GameControlsMenu controlsMenu
|
||||
- ScoreManager scoreManager
|
||||
- ScoreDisplay scoreDisplay
|
||||
+ <<Create>> Board(JFrame,long)
|
||||
+ GameControlsMenu getControlsMenu()
|
||||
+ void handleMouseMove(java.awt.event.MouseEvent)
|
||||
- void initializeNextTile()
|
||||
+ Tile getNextTile()
|
||||
+ void handleSpaceKeyPress()
|
||||
+ void handleMouseClick(java.awt.event.MouseEvent)
|
||||
- void initializeCentralTile()
|
||||
+ void addTile(Tile)
|
||||
+ Tile getTileAt(int,int)
|
||||
+ Random getRandom()
|
||||
+ Game getGame()
|
||||
- void calculateAvailablePositions(Tile)
|
||||
- boolean isTileAtPosition(Point)
|
||||
+ void placeTileAtPosition(Point)
|
||||
+ void autoReFocus(Tile)
|
||||
+ double getZoomFactor()
|
||||
+ void setZoomFactor(double)
|
||||
+ int getOffsetX()
|
||||
+ void setOffsetX(int)
|
||||
+ int getOffsetY()
|
||||
+ void setOffsetY(int)
|
||||
+ void zoomIn()
|
||||
+ void zoomOut()
|
||||
+ void moveBoard(int,int)
|
||||
+ void paintComponent(Graphics)
|
||||
}
|
||||
|
||||
|
||||
class fr.monkhanny.dorfromantik.game.PauseGame {
|
||||
- EscapeMenu escapeMenu
|
||||
- GameResumeButtonListener resumeButtonListener
|
||||
- GameQuitButtonListener quitButtonListener
|
||||
- GameSettingsButtonListener settingsButtonListener
|
||||
+ <<Create>> PauseGame(JFrame,Game)
|
||||
+ void keyPressed(KeyEvent)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
java.awt.event.KeyAdapter <|-- fr.monkhanny.dorfromantik.game.CustomKeyAdapter
|
||||
fr.monkhanny.dorfromantik.game.JFrame <|-- fr.monkhanny.dorfromantik.game.EscapeMenu
|
||||
fr.monkhanny.dorfromantik.game.JComponent <|-- fr.monkhanny.dorfromantik.game.Cell
|
||||
java.awt.event.MouseMotionAdapter <|-- fr.monkhanny.dorfromantik.game.CustomMouseMotionAdapter
|
||||
fr.monkhanny.dorfromantik.game.Cell <|-- fr.monkhanny.dorfromantik.game.Tile
|
||||
fr.monkhanny.dorfromantik.game.JPanel <|-- fr.monkhanny.dorfromantik.game.Board
|
||||
java.awt.event.KeyAdapter <|-- fr.monkhanny.dorfromantik.game.PauseGame
|
||||
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
|
||||
@enduml
|
Reference in New Issue
Block a user