From fe8f7273f0efdfe319a0d3e3b2fc2847992745af Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Mon, 21 Oct 2024 14:02:34 +0200 Subject: fix more design --- docs/class-diag.puml | 72 ++++++++++++++++++++++++---------------------------- docs/style.ipuml | 2 +- 2 files changed, 34 insertions(+), 40 deletions(-) (limited to 'docs') 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" <> { class FileReaderFactory <> { - +open(url) : FileReader& + + open(url) : FileReader& } interface FileReader { + read() : string @@ -92,9 +91,7 @@ rectangle Group_ParsingDeserialization as "Parsing & deserialization" <> CSVParser -r[hidden] TXTParser TXTParser -r[hidden] XMLParser } -} /' LAYOUT '/ -together { /' LAYOUT '/ rectangle Group_Algorithms as "Algorithms" <> { class Pathfinding { + Pathfinding(Museum &) @@ -149,7 +146,6 @@ rectangle Group_Model as "Model" <> { + 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" <> { + 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" <> { struct Color { red : unsigned int green : unsigned int blue : unsigned int } - class TileColorFactory { + class TileColorFactory <> { + get_color(string) : Color <> + register_color(string, Color) <> } - Tile --> Color - - Color <.. TileColorFactory -} -rectangle Group_TileBehavior as "Tile behavior" <> { interface TileBehavior { + step(Artist *) + update(Tile &) - + clone(Museum &) : uniq -- - # TileBehavior(type : string) - # TileBehavior() + # TileBehavior(Museum &) -- # interactions : unsigned int - # museum : Museum * + # museum : Museum & } class TileBehaviorFactory { - + get_strategy(string) : TileBehavior & <> - + register_strategy(string, TileBehavior *) <> + + TileBehaviorFactory(Museum &) + + create(string) : uniq -- - - get_collection() : TileBehaviorCollection & <> + - museum : Museum & } together { @@ -250,18 +225,42 @@ rectangle Group_TileBehavior as "Tile behavior" <> { } } + 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" <> { @@ -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 -- cgit v1.2.3