diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-09 17:08:46 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-09 17:08:46 +0200 |
commit | 76950c6100371c28f82f2e130dcfdb7d7dac97df (patch) | |
tree | 477714a58f6c6aecc65e5044cf6b1df41d40943a /docs | |
parent | 54831ea869e7e9da3e7b911f57de5949067c0bc5 (diff) |
WIP boilerplate engineering
Diffstat (limited to 'docs')
-rw-r--r-- | docs/class-diag.puml | 104 |
1 files changed, 58 insertions, 46 deletions
diff --git a/docs/class-diag.puml b/docs/class-diag.puml index 96a57f2..8d4fa68 100644 --- a/docs/class-diag.puml +++ b/docs/class-diag.puml @@ -3,10 +3,13 @@ ' TODO: ' - state snapshots (memento) ' - send commands from GUI +' - TileAppearance should have some kind of tile type -> color registry +' - everything added by the algorithms +' - artist collision behavior (both edges and artist-artist) !include style.ipuml -' !include hide-groups.ipuml +!include hide-groups.ipuml ' !include hide-details.ipuml class main as "main()" @@ -54,12 +57,18 @@ rectangle Group_FileReading as "File reading" <<group>> { } rectangle Group_ParsingDeserialization as "Parsing & deserialization" <<group>> { - interface ParserStrategy { - + parse(File, Deserializer) - + heuristic(File) : unsigned int + class Parser { + + parse(File, Deserializer) <<static>> + -- + - register_strategy(ParserStrategy) <<static>> + } + interface ParserStrategy { + + parse(File, Deserializer) <<static>> + + heuristic(File) : unsigned int <<static>> } - ParserStrategy ..> File + ParserStrategy .> Parser + ParserStrategy <. Parser class CSVParser class XMLParser @@ -71,23 +80,16 @@ rectangle Group_ParsingDeserialization as "Parsing & deserialization" <<group>> class Deserializer { + set_target(Museum &) - } - class PeopleDeserializer { + add_artist(uniq<ArtistData>) - } - class CanvasDeserializer { + set_rows(unsigned int) + set_cols(unsigned int) + add_type(string, Color, unsigned int) + add_tile(unsigned int x, unsigned int y, uniq<TileData>) } - PeopleDeserializer -up-|> Deserializer - CanvasDeserializer -up-|> Deserializer - - CSVParser -up-> PeopleDeserializer - XMLParser -up-> CanvasDeserializer - TXTParser -up-> CanvasDeserializer + CSVParser -up-> Deserializer + XMLParser -up-> Deserializer + TXTParser -up-> Deserializer ' ParserStrategy ..> Deserializer } @@ -95,20 +97,18 @@ rectangle Group_ParsingDeserialization as "Parsing & deserialization" <<group>> rectangle Group_Model as "Model" <<group>> { class Canvas { + get_tile(x, y) - + set_tile(x, y) + + set_tile(x, y, TileData) - data : CanvasData - tiles : Tile[] } class People { - + add_artist(uniq<artists>) : void + + add_artist(uniq<ArtistData>) - artists : Artist[] } class Museum { - + load : - - artists : People + - people : People - canvas : Canvas } - ' TODO color : Color? class Tile { + data : TileData } @@ -130,6 +130,41 @@ rectangle Group_Model as "Model" <<group>> { + rows : unsigned int + columns : unsigned int } + rectangle Group_Tile_Appearance as "Tile appearance" <<group>> { + struct Color { + red : unsigned int + green : unsigned int + blue : unsigned int + } + class TileAppearance { + + color : Color + } + + TileAppearance --> Color + + Tile --> "state" TileAppearance + } + rectangle Group_Tile_Behavior as "Tile behavior" <<group>> { + interface TileBehavior + + together { + class GrayTileBehavior + class RedTileBehavior + class BlueTileBehavior + class YellowTileBehavior + + GrayTileBehavior -d[hidden]- RedTileBehavior + RedTileBehavior -d[hidden]- BlueTileBehavior + BlueTileBehavior -d[hidden]- YellowTileBehavior + } + + TileBehavior <|.. GrayTileBehavior + TileBehavior <|.. RedTileBehavior + TileBehavior <|.. BlueTileBehavior + TileBehavior <|.. YellowTileBehavior + + Tile --> "state" TileBehavior + } Museum --> People Museum --> Canvas @@ -139,11 +174,11 @@ rectangle Group_Model as "Model" <<group>> { Tile --> TileData Artist --> ArtistData - Canvas --> CanvasData + + Canvas -> CanvasData ' LAYOUT Artist -r[hidden] Tile - Tile -r[hidden] CanvasData } rectangle "Visualization" <<group>> { @@ -159,34 +194,11 @@ rectangle "Visualization" <<group>> { View --> SDL2 } -' 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 - +ParserStrategy ..> File ' Museum .> Deserializer : friend Deserializer .> Museum |