aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-04 17:29:22 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-04 17:29:22 +0200
commit5fbcca2eecf5d4ce88749c16d2001f2e5d0a0ce8 (patch)
tree952c18d58b2dbc7bc4df7bb156ac28ce17974d94
parent9976d600c9252a9a4413b24c4389ea1c68e39901 (diff)
more tweaks + cleanup
-rw-r--r--docs/class-diag.puml138
-rw-r--r--docs/hide-details.ipuml2
-rw-r--r--docs/hide-groups.ipuml3
-rw-r--r--docs/style.ipuml26
4 files changed, 92 insertions, 77 deletions
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 <<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
+!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" <<group>> {
+open(url) : File&
}
interface File {
- # open(string url)
- + close()
+ read() : string
- # clone() const : File*
+ + close()
+ --
+ # open(string url)
+ # clone() : File* <<const>>
}
class LocalFile {
- instance : LocalFile <<static>>
@@ -70,6 +53,41 @@ rectangle "File reading" <<group>> {
CPR.Response - CPR.Url
}
+rectangle "Parsing & deserialization" <<group>> {
+ 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" <<group>> {
class Canvas {
+ get_tile(x, y)
@@ -93,6 +111,8 @@ rectangle "Model" <<group>> {
+ type : string
}
class Artist {
+ + update()
+ --
- data : ArtistData
}
struct ArtistData {
@@ -121,6 +141,18 @@ rectangle "Model" <<group>> {
Tile -r[hidden] CanvasData
}
+rectangle "Visualization" <<group>> {
+ 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<<group>>BorderColor transparent
+skinparam Rectangle<<group>>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 <<irrelevant>> for third-party classes
+hide <<irrelevant>> stereotype
+hide <<irrelevant>> members
+
+' rectangle <<group>>
+hide <<group>> stereotype
+skinparam Rectangle<<group>>BorderStyle dashed
+skinparam Rectangle<<group>>BorderColor gray
+