diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-21 14:02:34 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-21 14:02:34 +0200 |
commit | fe8f7273f0efdfe319a0d3e3b2fc2847992745af (patch) | |
tree | 9f56560c8a35c3e281881fa48cd79b26f8e8de7e /docs | |
parent | 4cb7ca42003c177e3acc80075d7594e555966106 (diff) |
fix more design
Diffstat (limited to 'docs')
-rw-r--r-- | docs/class-diag.puml | 72 | ||||
-rw-r--r-- | docs/style.ipuml | 2 |
2 files changed, 34 insertions, 40 deletions
diff --git a/docs/class-diag.puml b/docs/class-diag.puml index 56a334f..273e9f1 100644 --- a/docs/class-diag.puml +++ b/docs/class-diag.puml @@ -17,10 +17,9 @@ exception Exception { # va_format(va_list args, const char* fmt) } -together { /' LAYOUT '/ rectangle Group_FileReading as "File reading" <<group>> { class FileReaderFactory <<Factory>> { - +open(url) : FileReader& + + open(url) : FileReader& } interface FileReader { + read() : string @@ -92,9 +91,7 @@ rectangle Group_ParsingDeserialization as "Parsing & deserialization" <<group>> CSVParser -r[hidden] TXTParser TXTParser -r[hidden] XMLParser } -} /' LAYOUT '/ -together { /' LAYOUT '/ rectangle Group_Algorithms as "Algorithms" <<group>> { class Pathfinding { + Pathfinding(Museum &) @@ -149,7 +146,6 @@ rectangle Group_Model as "Model" <<group>> { + set_data(TileData &) + set_type(type : const string &) + update() - + step(Artist *) + get_neighbor(dx, dy) : Tile * -- - museum : Museum & @@ -179,52 +175,31 @@ rectangle Group_Model as "Model" <<group>> { + columns : unsigned int } - Museum --> People - Museum --> Canvas - - Canvas --> Tile - People --> Artist - - Tile -> TileData - Artist -l> ArtistData - Canvas -> CanvasData - - ' LAYOUT - Artist -r[hidden] Tile -} -rectangle Group_TileAppearance as "Tile appearance" <<group>> { struct Color { red : unsigned int green : unsigned int blue : unsigned int } - class TileColorFactory { + class TileColorFactory <<singleton>> { + get_color(string) : Color <<static>> + register_color(string, Color) <<static>> } - Tile --> Color - - Color <.. TileColorFactory -} -rectangle Group_TileBehavior as "Tile behavior" <<group>> { interface TileBehavior { + step(Artist *) + update(Tile &) - + clone(Museum &) : uniq<TileBehavior> -- - # TileBehavior(type : string) - # TileBehavior() + # TileBehavior(Museum &) -- # interactions : unsigned int - # museum : Museum * + # museum : Museum & } class TileBehaviorFactory { - + get_strategy(string) : TileBehavior & <<static>> - + register_strategy(string, TileBehavior *) <<static>> + + TileBehaviorFactory(Museum &) + + create(string) : uniq<TileBehavior> -- - - get_collection() : TileBehaviorCollection & <<static>> + - museum : Museum & } together { @@ -250,18 +225,42 @@ rectangle Group_TileBehavior as "Tile behavior" <<group>> { } } + Museum --> People + Museum --> Canvas + + Canvas --> Tile + People --> Artist + + Tile -> TileData + Artist -l> ArtistData + Canvas -> CanvasData + + Tile --> "state" Color + Tile .[norank].> TileColorFactory + + TileColorFactory .> Color + TileBehavior <|.. NullTileBehavior TileBehavior <|.. StepTileBehavior TileBehavior <|.. DeleteArtistTileBehavior TileBehavior <|.. SetNeighborTileBehavior TileBehavior <|.. CreateArtistTileBehavior - Tile --> "state" TileBehaviorFactory + TileBehaviorFactory --> NullTileBehavior + TileBehaviorFactory --> StepTileBehavior + TileBehaviorFactory --> DeleteArtistTileBehavior + TileBehaviorFactory --> SetNeighborTileBehavior + TileBehaviorFactory --> CreateArtistTileBehavior + + Tile --> "state" TileBehavior + Tile .[norank].> TileBehaviorFactory TileBehaviorFactory .l> TileBehavior TileBehaviorFactory <. TileBehavior + + ' LAYOUT + Artist -r[hidden] Tile } -} /' LAYOUT '/ together { /' LAYOUT '/ rectangle Group_Visualization as "Visualization" <<group>> { @@ -372,10 +371,5 @@ main -u-> LoadFilesCommand main -[norank]> View main .r> Exception -' LAYOUT -Group_TileBehavior -r[hidden] Group_TileAppearance -Group_ParsingDeserialization -r[hidden] Group_Model -' Collision -r[hidden] People - @enduml diff --git a/docs/style.ipuml b/docs/style.ipuml index ca4ece7..9fc8fc2 100644 --- a/docs/style.ipuml +++ b/docs/style.ipuml @@ -7,7 +7,7 @@ skinparam ClassFontStyle bold skinparam DefaultFontName Inter skinparam DefaultFontSize 10 skinparam MaxMessageSize 200 -skinparam Ranksep 25 +skinparam Ranksep 35 skinparam RoundCorner 0 skinparam PackageStyle rectangle skinparam PackageFontStyle italic |