From 9976d600c9252a9a4413b24c4389ea1c68e39901 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Fri, 4 Oct 2024 17:09:11 +0200 Subject: rearrange & group stuff --- docs/class-diag.puml | 189 +++++++++++++++++++++++++++++---------------------- 1 file changed, 106 insertions(+), 83 deletions(-) (limited to 'docs') diff --git a/docs/class-diag.puml b/docs/class-diag.puml index 7bd26f5..8eb4fa1 100644 --- a/docs/class-diag.puml +++ b/docs/class-diag.puml @@ -9,16 +9,25 @@ skinparam Linetype ortho skinparam ClassAttributeIconSize 0 skinparam ClassFontStyle bold skinparam DefaultFontName Inter -skinparam DefaultFontSize 14 +skinparam DefaultFontSize 10 skinparam MaxMessageSize 200 -' skinparam Nodesep 25 -skinparam Padding 2 -' skinparam Ranksep 50 +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 + class main as "main()" hide main circle hide main members @@ -30,49 +39,88 @@ exception Exception { # va_format(va_list args, const char* fmt) } -class FileReader <> { - +open(url) : File& -} - -interface File { - # open(string url) - + close() - + read() : string - # clone() const : File* -} - -class LocalFile { - - instance : LocalFile <> -} -class HTTPFile { - - instance : HTTPFile <> +rectangle "File reading" <> { + class FileReader <> { + +open(url) : File& + } + interface File { + # open(string url) + + close() + + read() : string + # clone() const : File* + } + class LocalFile { + - instance : LocalFile <> + } + class HTTPFile { + - instance : HTTPFile <> + } + package CPR { + class Response <> + class Url <> + } + + File <|.. LocalFile + File <|.. HTTPFile + + File <. FileReader + File .> FileReader + + HTTPFile --> CPR.Response + CPR.Response - CPR.Url +} + +rectangle "Model" <> { + class Canvas { + + get_tile(x, y) + + set_tile(x, y) + - data : CanvasData + - tiles : Tile[] + } + class People { + - artists : Artist[] + } + class Museum { + + load : + - artists : People + - canvas : Canvas + } + ' TODO color : Color? + class Tile { + + data : TileData + } + struct TileData { + + type : string + } + class Artist { + - data : ArtistData + } + struct ArtistData { + + x : float + + y : float + + vx : float + + vy : float + } + struct CanvasData { + + rows : unsigned int + + columns : unsigned int + } + + Museum --> People + Museum --> Canvas + + Canvas --> Tile + People --> Artist + + Tile --> TileData + Artist --> ArtistData + Canvas --> CanvasData + + ' LAYOUT + Artist -r[hidden] Tile + Tile -r[hidden] CanvasData } -class Canvas { - + get_tile(x, y) - + set_tile(x, y) - - data : CanvasData - - tiles : Tile[] -} - -class People { - - artists : Artist[] -} - -class Museum { - + load : - - artists : People - - canvas : Canvas -} - -' TODO color : Color? -class Tile { - + data : TileData -} - -struct TileData { - + type : string -} class TileAppearance { + color : Color @@ -85,21 +133,6 @@ class RedTileBehavior class BlueTileBehavior class YellowTileBehavior -class Artist { - - data : ArtistData -} - -struct ArtistData { - + x : float - + y : float - + vx : float - + vy : float -} - -struct CanvasData { - + rows : unsigned int - + columns : unsigned int -} class Deserializer class PeopleDeserializer { @@ -122,10 +155,6 @@ struct Color { blue : unsigned int } -package CPR { - class Response <> - class Url <> -} package SDL2 { } interface Parser { @@ -137,11 +166,14 @@ class CSVParser class XMLParser class TXTParser -File <|.. LocalFile -File <|.. HTTPFile +class View { + +} + +class ViewController { + +} -File <. FileReader -File .> FileReader TileBehavior <|-- GrayTileBehavior TileBehavior <|-- RedTileBehavior @@ -155,26 +187,17 @@ Parser <|-- XMLParser Deserializer <|-- PeopleDeserializer Deserializer <|-- CanvasDeserializer -HTTPFile --> CPR.Response -CPR.Response - CPR.Url - PeopleDeserializer <... People -CanvasDeserializer <... Canvas +CanvasDeserializer <... Canvas +Deserializer <... Museum -Museum --> People -Museum --> Canvas - -Canvas "1" --> "*" Tile -People "1" --> "*" Artist - -Tile --> TileData -Artist --> ArtistData -Canvas --> CanvasData - -CanvasDeserializer .r Color +TileAppearance .r Color File <.. Parser +ViewController --> View +View --> SDL2 + ' LAYOUT PeopleDeserializer -r[hidden] CanvasDeserializer -- cgit v1.2.3