mirror of
https://github.com/boudji-ludwig-pett/cnam-geometry-dash.git
synced 2025-02-17 12:28:10 +01:00
docs(uml): class diagram (#34)
This commit is contained in:
parent
5dc42fec95
commit
c6be884024
@ -5,46 +5,89 @@ skinparam classAttributeIconSize 0
|
|||||||
skinparam classFontStyle Bold
|
skinparam classFontStyle Bold
|
||||||
hide enum methods
|
hide enum methods
|
||||||
|
|
||||||
class Position {
|
class Player {
|
||||||
{field} + column: Integer
|
{field} + JUMP_FORCE: Double {readOnly}
|
||||||
{field} + row: Integer
|
{field} + SPEED: Double {readOnly}
|
||||||
|
{field} + SPEED: Double {readOnly}
|
||||||
|
|
||||||
{method} + Position(column: Integer, row: Integer)
|
{method} + jump()
|
||||||
{method} + equals(position: Position)
|
{method} + isJumping(): boolean
|
||||||
|
{method} + OnCollisionEnter2D(collision : Collision2D)
|
||||||
|
{method} + OnCollisionExit2D(collision : Collision2D)
|
||||||
}
|
}
|
||||||
|
|
||||||
class Level {
|
abstract class LevelElement {
|
||||||
{field} + songPath: String
|
{field} + x: Integer
|
||||||
{field} + backgroundPath: String
|
{field} + y: Integer
|
||||||
{field} + speed: Double
|
|
||||||
|
|
||||||
{method} + Level()
|
|
||||||
}
|
|
||||||
Level *--> "*\n- grid" GameObject : <<Is made up of>>
|
|
||||||
|
|
||||||
abstract class GameObject {
|
|
||||||
{method} + getImagePath(): String {abstract}
|
{method} + getImagePath(): String {abstract}
|
||||||
{method} + safeSides(): List<PositionSide> {abstract}
|
|
||||||
}
|
}
|
||||||
GameObject o--> "1\n- " Position : <<Has>>
|
|
||||||
GameObject ..> PositionSide : <<Uses>>
|
|
||||||
|
|
||||||
class Spike extends GameObject {}
|
class Obstacle extends LevelElement {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class Platform extends Obstacle {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class Spike extends Obstacle {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class Portal extends LevelElement {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class Bumper extends LevelElement {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class LevelEnd extends LevelElement {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class Level {
|
||||||
|
{field} + jsonPath: String
|
||||||
|
{field} + name: String
|
||||||
|
{field} + musicPath: String
|
||||||
|
{field} + progression: Integer
|
||||||
|
|
||||||
|
{field} + totalJumps: Integer
|
||||||
|
{field} + totalAttempts: Integer
|
||||||
|
{field} + killedCount: Integer
|
||||||
|
|
||||||
|
{method} + placeElements()
|
||||||
|
{method} + placeElement(levelElement: LevelElement) {static}
|
||||||
|
}
|
||||||
|
|
||||||
|
class LevelStats extends Stats {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class LevelFactory {
|
||||||
|
{method} + createLevel(jsonPath): Level
|
||||||
|
}
|
||||||
|
|
||||||
class Game {
|
class Game {
|
||||||
{field} - score: Integer
|
|
||||||
|
|
||||||
{method} + start(): void
|
|
||||||
{method} + restart(): void
|
|
||||||
{method} + end(): void
|
|
||||||
}
|
}
|
||||||
Game o--> "1\n- currentLevel" Level : <<Has>>
|
|
||||||
|
|
||||||
enum PositionSide <<enumeration>> {
|
Level *--> "- *\nLevelElements" LevelElement : <<Owns>>
|
||||||
TOP
|
Game *--> "- *\nlevels" Level : <<Owns>>
|
||||||
RIGHT
|
Game *--> "- 1\nlevels" LevelFactory : <<Owns>>
|
||||||
BOTTOM
|
|
||||||
LEFT
|
' {
|
||||||
}
|
' "name": "Back on Track",
|
||||||
|
' "music"
|
||||||
|
' "elements": [
|
||||||
|
' {
|
||||||
|
' "type": "Spike",
|
||||||
|
' "position": {
|
||||||
|
' "x": 0,
|
||||||
|
' "y": 0
|
||||||
|
' },
|
||||||
|
' }
|
||||||
|
' ]
|
||||||
|
' }
|
||||||
|
|
||||||
|
|
||||||
@enduml
|
@enduml
|
||||||
|
Loading…
x
Reference in New Issue
Block a user