aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-05 17:23:20 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-05 17:23:20 +0200
commit54831ea869e7e9da3e7b911f57de5949067c0bc5 (patch)
tree3b67831a22eb3b41c3d6c7e82452b9ce9a34b2f5 /docs
parent5fbcca2eecf5d4ce88749c16d2001f2e5d0a0ce8 (diff)
more design thoncc
Diffstat (limited to 'docs')
-rw-r--r--docs/class-diag.puml105
-rw-r--r--docs/hide-details.ipuml2
2 files changed, 57 insertions, 50 deletions
diff --git a/docs/class-diag.puml b/docs/class-diag.puml
index eef4cf2..96a57f2 100644
--- a/docs/class-diag.puml
+++ b/docs/class-diag.puml
@@ -21,7 +21,7 @@ exception Exception {
# va_format(va_list args, const char* fmt)
}
-rectangle "File reading" <<group>> {
+rectangle Group_FileReading as "File reading" <<group>> {
class FileReader <<Factory>> {
+open(url) : File&
}
@@ -53,42 +53,46 @@ rectangle "File reading" <<group>> {
CPR.Response - CPR.Url
}
-rectangle "Parsing & deserialization" <<group>> {
- interface Parser {
- + parse(File)
+rectangle Group_ParsingDeserialization as "Parsing & deserialization" <<group>> {
+ interface ParserStrategy {
+ + parse(File, Deserializer)
+ heuristic(File) : unsigned int
}
- File <.. Parser
+ ParserStrategy ..> File
class CSVParser
class XMLParser
class TXTParser
- Parser <|-- CSVParser
- Parser <|-- TXTParser
- Parser <|-- XMLParser
+ CSVParser ..|> ParserStrategy
+ TXTParser ..|> ParserStrategy
+ XMLParser ..|> ParserStrategy
- class Deserializer
+ class Deserializer {
+ + set_target(Museum &)
+ }
class PeopleDeserializer {
- + set_target(People &)
- --
- + add_artist(float, float, float, float)
+ + add_artist(uniq<ArtistData>)
}
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)
+ + set_cols(unsigned int)
+ + add_type(string, Color, unsigned int)
+ + add_tile(unsigned int x, unsigned int y, uniq<TileData>)
}
- Deserializer <|-- PeopleDeserializer
- Deserializer <|-- CanvasDeserializer
+ PeopleDeserializer -up-|> Deserializer
+ CanvasDeserializer -up-|> Deserializer
+
+ CSVParser -up-> PeopleDeserializer
+ XMLParser -up-> CanvasDeserializer
+ TXTParser -up-> CanvasDeserializer
+
+ ' ParserStrategy ..> Deserializer
}
-rectangle "Model" <<group>> {
+rectangle Group_Model as "Model" <<group>> {
class Canvas {
+ get_tile(x, y)
+ set_tile(x, y)
@@ -96,6 +100,7 @@ rectangle "Model" <<group>> {
- tiles : Tile[]
}
class People {
+ + add_artist(uniq<artists>) : void
- artists : Artist[]
}
class Museum {
@@ -154,36 +159,36 @@ rectangle "Visualization" <<group>> {
View --> SDL2
}
-class TileAppearance {
- + color : Color
-}
-
-class TileBehavior
-
-class GrayTileBehavior
-class RedTileBehavior
-class BlueTileBehavior
-class YellowTileBehavior
-
-struct Color {
- red : unsigned int
- green : unsigned int
- blue : unsigned int
-}
-
-PeopleDeserializer <... People
-CanvasDeserializer <... Canvas
-Deserializer <... Museum
-
-TileBehavior <|-- GrayTileBehavior
-TileBehavior <|-- RedTileBehavior
-TileBehavior <|-- BlueTileBehavior
-TileBehavior <|-- YellowTileBehavior
-
-TileAppearance .r Color
-
-' LAYOUT
-PeopleDeserializer -r[hidden] CanvasDeserializer
+' class TileBehavior
+'
+' class GrayTileBehavior
+' class RedTileBehavior
+' class BlueTileBehavior
+' class YellowTileBehavior
+'
+' TileBehavior <|-- GrayTileBehavior
+' TileBehavior <|-- RedTileBehavior
+' TileBehavior <|-- BlueTileBehavior
+' TileBehavior <|-- YellowTileBehavior
+
+' struct Color {
+' red : unsigned int
+' green : unsigned int
+' blue : unsigned int
+' }
+
+' PeopleDeserializer <... People
+' CanvasDeserializer <... Canvas
+' Deserializer <... Museum
+
+' class TileAppearance {
+' + color : Color
+' }
+'
+' TileAppearance .r Color
+
+' Museum .> Deserializer : friend
+Deserializer .> Museum
@enduml
diff --git a/docs/hide-details.ipuml b/docs/hide-details.ipuml
index c67758e..e2d926b 100644
--- a/docs/hide-details.ipuml
+++ b/docs/hide-details.ipuml
@@ -1,2 +1,4 @@
' vim:ft=plantuml
hide members
+skinparam Nodesep 40
+skinparam Ranksep 40