diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/class-diag.puml | 99 |
1 files changed, 76 insertions, 23 deletions
diff --git a/docs/class-diag.puml b/docs/class-diag.puml index fb77035..a475575 100644 --- a/docs/class-diag.puml +++ b/docs/class-diag.puml @@ -1,26 +1,33 @@ @startuml +' TODO: +' - state snapshots (memento) +' - send commands from GUI + !theme plain -skinparam linetype ortho -skinparam classAttributeIconSize 0 +skinparam Linetype ortho +skinparam ClassAttributeIconSize 0 skinparam ClassFontStyle bold skinparam DefaultFontName Inter skinparam DefaultFontSize 14 skinparam MaxMessageSize 200 -skinparam Nodesep 25 +' skinparam Nodesep 25 skinparam Padding 2 -skinparam Ranksep 50 +' skinparam Ranksep 50 skinparam RoundCorner 0 +skinparam PackageStyle rectangle +hide <<irrelevant>> stereotype +hide <<irrelevant>> members class main as "main()" hide main circle hide main members exception Exception { - Exception(const char* fmt, ...) - +what() : const char* - #error : char* - #va_format(va_list args, const char* fmt) + + Exception(const char* fmt, ...) + + what() : const char* + # error : char* + # va_format(va_list args, const char* fmt) } class FileReader <<Factory>> { @@ -28,27 +35,38 @@ class FileReader <<Factory>> { } interface File { - #open(string url) - +close() - +read() : string - #clone() const : File* + # open(string url) + + close() + + read() : string + # clone() const : File* } class LocalFile { - -static instance : LocalFile + - instance : LocalFile <<static>> } class HTTPFile { - -static instance : HTTPFile + - instance : HTTPFile <<static>> } class Canvas { + get_tile(x, y) + set_tile(x, y) + - tiles : Tile[] +} + +class Artists { + - artists : Artist[] +} + +class World { + + load : + - artists : Artists + - canvas : Canvas } class Tile -class TileFactory +class TileAppearance class TileBehavior @@ -60,14 +78,35 @@ class YellowTileBehavior class Artist class Deserializer -class ArtistDeserializer -class CanvasDeserializer +class ArtistsDeserializer { + + set_target(Artists &) + -- + + add_artist(float, float, float, float) +} +class CanvasDeserializer { + + set_target(Canvas &) + -- + + set_meta_rows(unsigned int) + + set_meta_cols(unsigned int) + + add_meta_type(string, Color, unsigned int) + + add_tile(unsigned int, unsigned int, string) +} -package CPR { } +struct Color { + red : unsigned int + green : unsigned int + blue : unsigned int +} + +package CPR { + class Response <<irrelevant>> + class Url <<irrelevant>> +} package SDL2 { } interface Parser { - +parse(File) + + parse(File) + + heuristic(File) : unsigned int } class CSVParser @@ -76,9 +115,13 @@ class TXTParser File <|.. LocalFile File <|.. HTTPFile + File <. FileReader File .> FileReader -Canvas "1" -> "*" Tile + +Canvas "1" -> "*" Tile +Artists "1" -> "*" Artist + TileBehavior <|-- GrayTileBehavior TileBehavior <|-- RedTileBehavior TileBehavior <|-- BlueTileBehavior @@ -88,14 +131,24 @@ Parser <|-- CSVParser Parser <|-- TXTParser Parser <|-- XMLParser -Deserializer <|-- ArtistDeserializer +Deserializer <|-- ArtistsDeserializer Deserializer <|-- CanvasDeserializer -HTTPFile ..> CPR +HTTPFile --> CPR.Response +CPR.Response - CPR.Url + +ArtistsDeserializer <... Artists +CanvasDeserializer <... Canvas + +World <-- Artists +World <-- Canvas -TileFactory --> Tile +CanvasDeserializer .r Color +File <.. Parser +' LAYOUT +ArtistsDeserializer -r[hidden] CanvasDeserializer @enduml |