diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-04 17:09:11 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-04 17:09:11 +0200 |
commit | 9976d600c9252a9a4413b24c4389ea1c68e39901 (patch) | |
tree | d3b0b0921002ac3f73442317927ad75c9e9720b6 | |
parent | 7e7d1971bdffdc19366f92af51e446ff4870f026 (diff) |
rearrange & group stuff
-rw-r--r-- | docs/class-diag.puml | 189 |
1 files changed, 106 insertions, 83 deletions
diff --git a/docs/class-diag.puml b/docs/class-diag.puml index 7bd26f5..8eb4fa1 100644 --- a/docs/class-diag.puml +++ b/docs/class-diag.puml @@ -9,16 +9,25 @@ skinparam Linetype ortho skinparam ClassAttributeIconSize 0 skinparam ClassFontStyle bold skinparam DefaultFontName Inter -skinparam DefaultFontSize 14 +skinparam DefaultFontSize 10 skinparam MaxMessageSize 200 -' skinparam Nodesep 25 -skinparam Padding 2 -' skinparam Ranksep 50 +skinparam Ranksep 25 skinparam RoundCorner 0 skinparam PackageStyle rectangle +' skinparam Nodesep 25 +' skinparam Padding 0 + hide <<irrelevant>> stereotype hide <<irrelevant>> members +hide <<group>> stereotype +skinparam Rectangle<<group>>BorderStyle dashed +skinparam Rectangle<<group>>BorderColor gray + +' Uncomment to hide groups: +' skinparam Rectangle<<group>>BorderColor transparent +' skinparam Rectangle<<group>>FontSize 0 + class main as "main()" hide main circle hide main members @@ -30,49 +39,88 @@ exception Exception { # va_format(va_list args, const char* fmt) } -class FileReader <<Factory>> { - +open(url) : File& -} - -interface File { - # open(string url) - + close() - + read() : string - # clone() const : File* -} - -class LocalFile { - - instance : LocalFile <<static>> -} -class HTTPFile { - - instance : HTTPFile <<static>> +rectangle "File reading" <<group>> { + class FileReader <<Factory>> { + +open(url) : File& + } + interface File { + # open(string url) + + close() + + read() : string + # clone() const : File* + } + class LocalFile { + - instance : LocalFile <<static>> + } + class HTTPFile { + - instance : HTTPFile <<static>> + } + package CPR { + class Response <<irrelevant>> + class Url <<irrelevant>> + } + + File <|.. LocalFile + File <|.. HTTPFile + + File <. FileReader + File .> FileReader + + HTTPFile --> CPR.Response + CPR.Response - CPR.Url +} + +rectangle "Model" <<group>> { + class Canvas { + + get_tile(x, y) + + set_tile(x, y) + - data : CanvasData + - tiles : Tile[] + } + class People { + - artists : Artist[] + } + class Museum { + + load : + - artists : People + - canvas : Canvas + } + ' TODO color : Color? + class Tile { + + data : TileData + } + struct TileData { + + type : string + } + class Artist { + - data : ArtistData + } + struct ArtistData { + + x : float + + y : float + + vx : float + + vy : float + } + struct CanvasData { + + rows : unsigned int + + columns : unsigned int + } + + Museum --> People + Museum --> Canvas + + Canvas --> Tile + People --> Artist + + Tile --> TileData + Artist --> ArtistData + Canvas --> CanvasData + + ' LAYOUT + Artist -r[hidden] Tile + Tile -r[hidden] CanvasData } -class Canvas { - + get_tile(x, y) - + set_tile(x, y) - - data : CanvasData - - tiles : Tile[] -} - -class People { - - artists : Artist[] -} - -class Museum { - + load : - - artists : People - - canvas : Canvas -} - -' TODO color : Color? -class Tile { - + data : TileData -} - -struct TileData { - + type : string -} class TileAppearance { + color : Color @@ -85,21 +133,6 @@ class RedTileBehavior class BlueTileBehavior class YellowTileBehavior -class Artist { - - data : ArtistData -} - -struct ArtistData { - + x : float - + y : float - + vx : float - + vy : float -} - -struct CanvasData { - + rows : unsigned int - + columns : unsigned int -} class Deserializer class PeopleDeserializer { @@ -122,10 +155,6 @@ struct Color { blue : unsigned int } -package CPR { - class Response <<irrelevant>> - class Url <<irrelevant>> -} package SDL2 { } interface Parser { @@ -137,11 +166,14 @@ class CSVParser class XMLParser class TXTParser -File <|.. LocalFile -File <|.. HTTPFile +class View { + +} + +class ViewController { + +} -File <. FileReader -File .> FileReader TileBehavior <|-- GrayTileBehavior TileBehavior <|-- RedTileBehavior @@ -155,26 +187,17 @@ Parser <|-- XMLParser Deserializer <|-- PeopleDeserializer Deserializer <|-- CanvasDeserializer -HTTPFile --> CPR.Response -CPR.Response - CPR.Url - PeopleDeserializer <... People -CanvasDeserializer <... Canvas +CanvasDeserializer <... Canvas +Deserializer <... Museum -Museum --> People -Museum --> Canvas - -Canvas "1" --> "*" Tile -People "1" --> "*" Artist - -Tile --> TileData -Artist --> ArtistData -Canvas --> CanvasData - -CanvasDeserializer .r Color +TileAppearance .r Color File <.. Parser +ViewController --> View +View --> SDL2 + ' LAYOUT PeopleDeserializer -r[hidden] CanvasDeserializer |