aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-14 23:45:19 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-14 23:45:19 +0200
commit28ed8918eaf62969f507fc678b4ac31f195bf257 (patch)
tree83fe2155c9b4359aa41810b14abbba27f2a828c1
parent70dbffca112f7deb26a470c12ae56d11137aae86 (diff)
more class diagram
-rw-r--r--docs/class-diag.puml145
-rw-r--r--docs/style.ipuml4
2 files changed, 98 insertions, 51 deletions
diff --git a/docs/class-diag.puml b/docs/class-diag.puml
index 34c9506..a686394 100644
--- a/docs/class-diag.puml
+++ b/docs/class-diag.puml
@@ -48,7 +48,6 @@ rectangle Group_FileReading as "File reading" <<group>> {
HTTPFile --> CPR.Response
CPR.Response - CPR.Url
}
-
rectangle Group_ParsingDeserialization as "Parsing & deserialization" <<group>> {
class Parser {
+ parse(File, Deserializer) <<static>>
@@ -122,74 +121,76 @@ rectangle Group_Model as "Model" <<group>> {
+ rows : unsigned int
+ columns : unsigned int
}
- rectangle Group_Tile_Appearance as "Tile appearance" <<group>> {
- struct Color {
- red : unsigned int
- green : unsigned int
- blue : unsigned int
- }
- class TileAppearance {
- + get_color(string) : Color <<static>>
- + register_color(string, Color) <<static>>
- }
- Tile --> Color
+ Museum --> People
+ Museum --> Canvas
- Color <.. TileAppearance
- }
- rectangle Group_Tile_Behavior as "Tile behavior" <<group>> {
- interface TileBehaviorStrategy
+ Canvas --> Tile
+ People --> Artist
- class TileBehavior
+ Tile -> TileData
+ Artist -l> ArtistData
+ Canvas -> CanvasData
- together {
- class NullTileBehavior
+ ' LAYOUT
+ Artist -r[hidden] Tile
+}
- class GrayTileBehavior
- class RedTileBehavior
- class BlueTileBehavior
- class YellowTileBehavior
+rectangle Group_TileAppearance as "Tile appearance" <<group>> {
+ struct Color {
+ red : unsigned int
+ green : unsigned int
+ blue : unsigned int
+ }
+ class TileAppearance {
+ + get_color(string) : Color <<static>>
+ + register_color(string, Color) <<static>>
+ }
- NullTileBehavior -d[hidden]- GrayTileBehavior
- GrayTileBehavior -d[hidden]- RedTileBehavior
- RedTileBehavior -d[hidden]- BlueTileBehavior
- BlueTileBehavior -d[hidden]- YellowTileBehavior
- }
+ Tile --> Color
- TileBehaviorStrategy <|.. NullTileBehavior
- TileBehaviorStrategy <|.. GrayTileBehavior
- TileBehaviorStrategy <|.. RedTileBehavior
- TileBehaviorStrategy <|.. BlueTileBehavior
- TileBehaviorStrategy <|.. YellowTileBehavior
+ Color <.. TileAppearance
+}
+rectangle Group_TileBehavior as "Tile behavior" <<group>> {
+ interface TileBehaviorStrategy
- Tile --> "state" TileBehavior
+ class TileBehavior
- TileBehavior .> TileBehaviorStrategy
- TileBehavior <. TileBehaviorStrategy
- }
+ together {
+ class NullTileBehavior
- Museum --> People
- Museum --> Canvas
+ class GrayTileBehavior
+ class RedTileBehavior
+ class BlueTileBehavior
+ class YellowTileBehavior
- Canvas --> Tile
- People --> Artist
+ NullTileBehavior -d[hidden]- GrayTileBehavior
+ GrayTileBehavior -d[hidden]- RedTileBehavior
+ RedTileBehavior -d[hidden]- BlueTileBehavior
+ BlueTileBehavior -d[hidden]- YellowTileBehavior
+ }
- Tile --> TileData
- Artist --> ArtistData
+ TileBehaviorStrategy <|.. NullTileBehavior
+ TileBehaviorStrategy <|.. GrayTileBehavior
+ TileBehaviorStrategy <|.. RedTileBehavior
+ TileBehaviorStrategy <|.. BlueTileBehavior
+ TileBehaviorStrategy <|.. YellowTileBehavior
- Canvas -> CanvasData
+ Tile --> "state" TileBehavior
- ' LAYOUT
- Artist -r[hidden] Tile
+ TileBehavior .l> TileBehaviorStrategy
+ TileBehavior <. TileBehaviorStrategy
}
-rectangle "Visualization" <<group>> {
+rectangle Group_Visualization as "Visualization" <<group>> {
struct Rectangle {
x : unsigned int
y : unsigned int
width : unsigned int
height : unsigned int
}
+ enum Scancode {
+ }
package SDL2 { }
class View {
@@ -198,8 +199,38 @@ rectangle "Visualization" <<group>> {
+ update()
}
- ViewController --> View
- View --> SDL2
+ ViewController ..> View
+ ViewController <-- View
+ View -> SDL2
+}
+
+rectangle Group_Commands as "Commands" <<group>> {
+ class Command <<abstract>> {
+ #museum : Museum&
+ #view : View&
+ #controller : ViewController&
+ +Command(museum, view, controller)
+ }
+
+ class MuseumPauseCommand {
+ +toggle()
+ +set(paused : bool)
+ }
+ class OpenFileGUICommand {
+ +execute()
+ }
+ class ArtistVisibilityCommand {
+ +toggle()
+ +set(paused : bool)
+ }
+
+ Command <|-u- MuseumPauseCommand
+ Command <|-u- OpenFileGUICommand
+ Command <|-u- ArtistVisibilityCommand
+
+ Command .d..> Museum
+ Command ...d[norank]> View
+ Command ...d[norank]> ViewController
}
' PeopleDeserializer <... People
@@ -210,5 +241,21 @@ ParserStrategy ..> FileStrategy
' Museum .> Deserializer : friend
Deserializer .> Museum
+ViewController -[norank]> Command
+
+main --> Museum
+main --[norank]> Deserializer
+main --[norank]> View
+' DETAIL: main ..[norank]> FileReader
+' DETAIL: main ..[norank]> Parser
+
+' LAYOUT
+Group_ParsingDeserialization -d[hidden] Group_FileReading
+Group_TileBehavior -r[hidden] Group_TileAppearance
+Group_Model -r[hidden] Group_ParsingDeserialization
+Group_Model -l[hidden] main
+' Group_Model -d[hidden] Group_TileBehavior
+' Group_Model -d[hidden] Group_TileAppearance
+
@enduml
diff --git a/docs/style.ipuml b/docs/style.ipuml
index ceb1e65..ca4ece7 100644
--- a/docs/style.ipuml
+++ b/docs/style.ipuml
@@ -11,8 +11,8 @@ skinparam Ranksep 25
skinparam RoundCorner 0
skinparam PackageStyle rectangle
skinparam PackageFontStyle italic
-' skinparam Nodesep 25
-' skinparam Padding 0
+skinparam Nodesep 45
+skinparam Padding 0
hide class circle
' class <<irrelevant>> for third-party classes