@startuml ' TODO: ' - state snapshots (memento) ' - send commands from GUI !theme plain skinparam Linetype ortho skinparam ClassAttributeIconSize 0 skinparam ClassFontStyle bold skinparam DefaultFontName Inter skinparam DefaultFontSize 14 skinparam MaxMessageSize 200 ' skinparam Nodesep 25 skinparam Padding 2 ' skinparam Ranksep 50 skinparam RoundCorner 0 skinparam PackageStyle rectangle hide <> stereotype hide <> 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) } class FileReader <> { +open(url) : File& } interface File { # open(string url) + close() + read() : string # clone() const : File* } class LocalFile { - instance : LocalFile <> } class HTTPFile { - instance : HTTPFile <> } 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 TileAppearance class TileBehavior class GrayTileBehavior class RedTileBehavior class BlueTileBehavior class YellowTileBehavior class Artist class Deserializer 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) } struct Color { red : unsigned int green : unsigned int blue : unsigned int } package CPR { class Response <> class Url <> } package SDL2 { } interface Parser { + parse(File) + heuristic(File) : unsigned int } class CSVParser class XMLParser class TXTParser File <|.. LocalFile File <|.. HTTPFile File <. FileReader File .> FileReader Canvas "1" -> "*" Tile Artists "1" -> "*" Artist TileBehavior <|-- GrayTileBehavior TileBehavior <|-- RedTileBehavior TileBehavior <|-- BlueTileBehavior TileBehavior <|-- YellowTileBehavior Parser <|-- CSVParser Parser <|-- TXTParser Parser <|-- XMLParser Deserializer <|-- ArtistsDeserializer Deserializer <|-- CanvasDeserializer HTTPFile --> CPR.Response CPR.Response - CPR.Url ArtistsDeserializer <... Artists CanvasDeserializer <... Canvas World <-- Artists World <-- Canvas CanvasDeserializer .r Color File <.. Parser ' LAYOUT ArtistsDeserializer -r[hidden] CanvasDeserializer @enduml