From 5fbcca2eecf5d4ce88749c16d2001f2e5d0a0ce8 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Fri, 4 Oct 2024 17:29:22 +0200 Subject: more tweaks + cleanup --- docs/class-diag.puml | 138 +++++++++++++++++++++--------------------------- docs/hide-details.ipuml | 2 + docs/hide-groups.ipuml | 3 ++ docs/style.ipuml | 26 +++++++++ 4 files changed, 92 insertions(+), 77 deletions(-) create mode 100644 docs/hide-details.ipuml create mode 100644 docs/hide-groups.ipuml create mode 100644 docs/style.ipuml (limited to 'docs') diff --git a/docs/class-diag.puml b/docs/class-diag.puml index 8eb4fa1..eef4cf2 100644 --- a/docs/class-diag.puml +++ b/docs/class-diag.puml @@ -4,29 +4,10 @@ ' - state snapshots (memento) ' - send commands from GUI -!theme plain -skinparam Linetype ortho -skinparam ClassAttributeIconSize 0 -skinparam ClassFontStyle bold -skinparam DefaultFontName Inter -skinparam DefaultFontSize 10 -skinparam MaxMessageSize 200 -skinparam Ranksep 25 -skinparam RoundCorner 0 -skinparam PackageStyle rectangle -' skinparam Nodesep 25 -' skinparam Padding 0 - -hide <> stereotype -hide <> members - -hide <> stereotype -skinparam Rectangle<>BorderStyle dashed -skinparam Rectangle<>BorderColor gray - -' Uncomment to hide groups: -' skinparam Rectangle<>BorderColor transparent -' skinparam Rectangle<>FontSize 0 +!include style.ipuml + +' !include hide-groups.ipuml +' !include hide-details.ipuml class main as "main()" hide main circle @@ -35,6 +16,7 @@ hide main members exception Exception { + Exception(const char* fmt, ...) + what() : const char* + -- # error : char* # va_format(va_list args, const char* fmt) } @@ -44,10 +26,11 @@ rectangle "File reading" <> { +open(url) : File& } interface File { - # open(string url) - + close() + read() : string - # clone() const : File* + + close() + -- + # open(string url) + # clone() : File* <> } class LocalFile { - instance : LocalFile <> @@ -70,6 +53,41 @@ rectangle "File reading" <> { CPR.Response - CPR.Url } +rectangle "Parsing & deserialization" <> { + interface Parser { + + parse(File) + + heuristic(File) : unsigned int + } + + File <.. Parser + + class CSVParser + class XMLParser + class TXTParser + + Parser <|-- CSVParser + Parser <|-- TXTParser + Parser <|-- XMLParser + + class Deserializer + class PeopleDeserializer { + + set_target(People &) + -- + + add_artist(float, float, float, float) + } + class CanvasDeserializer { + + set_target(Canvas &) + -- + + set_rows(unsigned int) + + set_meta_cols(unsigned int) + + add_meta_type(string, Color, unsigned int) + + add_tile(unsigned int, unsigned int, string) + } + + Deserializer <|-- PeopleDeserializer + Deserializer <|-- CanvasDeserializer +} + rectangle "Model" <> { class Canvas { + get_tile(x, y) @@ -93,6 +111,8 @@ rectangle "Model" <> { + type : string } class Artist { + + update() + -- - data : ArtistData } struct ArtistData { @@ -121,6 +141,18 @@ rectangle "Model" <> { Tile -r[hidden] CanvasData } +rectangle "Visualization" <> { + package SDL2 { } + class View { + + } + class ViewController { + + } + + ViewController --> View + View --> SDL2 +} class TileAppearance { + color : Color @@ -133,71 +165,23 @@ class RedTileBehavior class BlueTileBehavior class YellowTileBehavior - -class Deserializer -class PeopleDeserializer { - + set_target(People &) - -- - + add_artist(float, float, float, float) -} -class CanvasDeserializer { - + set_target(Canvas &) - -- - + set_rows(unsigned int) - + set_meta_cols(unsigned int) - + add_meta_type(string, Color, unsigned int) - + add_tile(unsigned int, unsigned int, string) -} - struct Color { red : unsigned int green : unsigned int blue : unsigned int } -package SDL2 { } - -interface Parser { - + parse(File) - + heuristic(File) : unsigned int -} - -class CSVParser -class XMLParser -class TXTParser - -class View { - -} - -class ViewController { - -} - +PeopleDeserializer <... People +CanvasDeserializer <... Canvas +Deserializer <... Museum TileBehavior <|-- GrayTileBehavior TileBehavior <|-- RedTileBehavior TileBehavior <|-- BlueTileBehavior TileBehavior <|-- YellowTileBehavior -Parser <|-- CSVParser -Parser <|-- TXTParser -Parser <|-- XMLParser - -Deserializer <|-- PeopleDeserializer -Deserializer <|-- CanvasDeserializer - -PeopleDeserializer <... People -CanvasDeserializer <... Canvas -Deserializer <... Museum - TileAppearance .r Color -File <.. Parser - -ViewController --> View -View --> SDL2 - ' LAYOUT PeopleDeserializer -r[hidden] CanvasDeserializer diff --git a/docs/hide-details.ipuml b/docs/hide-details.ipuml new file mode 100644 index 0000000..c67758e --- /dev/null +++ b/docs/hide-details.ipuml @@ -0,0 +1,2 @@ +' vim:ft=plantuml +hide members diff --git a/docs/hide-groups.ipuml b/docs/hide-groups.ipuml new file mode 100644 index 0000000..abf9283 --- /dev/null +++ b/docs/hide-groups.ipuml @@ -0,0 +1,3 @@ +' vim:ft=plantuml +skinparam Rectangle<>BorderColor transparent +skinparam Rectangle<>FontSize 0 diff --git a/docs/style.ipuml b/docs/style.ipuml new file mode 100644 index 0000000..ceb1e65 --- /dev/null +++ b/docs/style.ipuml @@ -0,0 +1,26 @@ +' vim:ft=plantuml + +!theme plain +skinparam Linetype ortho +skinparam ClassAttributeIconSize 0 +skinparam ClassFontStyle bold +skinparam DefaultFontName Inter +skinparam DefaultFontSize 10 +skinparam MaxMessageSize 200 +skinparam Ranksep 25 +skinparam RoundCorner 0 +skinparam PackageStyle rectangle +skinparam PackageFontStyle italic +' skinparam Nodesep 25 +' skinparam Padding 0 +hide class circle + +' class <> for third-party classes +hide <> stereotype +hide <> members + +' rectangle <> +hide <> stereotype +skinparam Rectangle<>BorderStyle dashed +skinparam Rectangle<>BorderColor gray + -- cgit v1.2.3