diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-18 15:43:25 +0200 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-18 15:43:25 +0200 |
commit | 76e61d68bbf568ec0d7fc4632e52d4de5496b003 (patch) | |
tree | 92a2dc9b12a542456bdc154f44deb34925883210 /docs/class-diag.puml | |
parent | 3f63576819151ff15237a9b4f0651c538cfef067 (diff) |
(1/2) rename
Diffstat (limited to 'docs/class-diag.puml')
-rw-r--r-- | docs/class-diag.puml | 122 |
1 files changed, 61 insertions, 61 deletions
diff --git a/docs/class-diag.puml b/docs/class-diag.puml index 8495b16..a6fc1cf 100644 --- a/docs/class-diag.puml +++ b/docs/class-diag.puml @@ -19,49 +19,49 @@ exception Exception { together { /' LAYOUT '/ rectangle Group_FileReading as "File reading" <<group>> { - class FileReader <<Factory>> { - +open(url) : FileStrategy& + class FileReaderFactory <<Factory>> { + +open(url) : FileReader& } - interface FileStrategy { + interface FileReader { + read() : string + close() -- # open(string url) - # clone() : FileStrategy* <<const>> + # clone() : FileReader* <<const>> } - class LocalFile { - - instance : LocalFile <<static>> + class LocalFileReader { + - instance : LocalFileReader <<static>> } - class HTTPFile { - - instance : HTTPFile <<static>> + class HTTPFileReader { + - instance : HTTPFileReader <<static>> } package CPR { } - FileStrategy <|.u. LocalFile - FileStrategy <|.u. HTTPFile + FileReader <|.u. LocalFileReader + FileReader <|.u. HTTPFileReader - FileStrategy .l> FileReader - FileStrategy <. FileReader + FileReader .l> FileReaderFactory + FileReader <. FileReaderFactory - HTTPFile -l> CPR + HTTPFileReader -l> CPR ' LAYOUT - HTTPFile -r[hidden] LocalFile + HTTPFileReader -r[hidden] LocalFileReader } rectangle Group_ParsingDeserialization as "Parsing & deserialization" <<group>> { - class Parser { - + parse(FileStrategy &, Deserializer &) <<static>> - + register_strategy(ParserStrategy *) <<static>> + class ParserFactory { + + parse(FileReader &, MuseumDeserializer &) <<static>> + + register_strategy(Parser *) <<static>> -- - get_collection() : ParserCollection <<static>> } - interface ParserStrategy { - + parse(FileStrategy &, Deserializer &) <<static>> - + heuristic(FileStrategy &) : unsigned int <<static>> + interface Parser { + + parse(FileReader &, MuseumDeserializer &) <<static>> + + heuristic(FileReader &) : unsigned int <<static>> } - ParserStrategy .> Parser - ParserStrategy <. Parser + Parser .> ParserFactory + Parser <. ParserFactory class CSVParser class XMLParser @@ -69,14 +69,14 @@ rectangle Group_ParsingDeserialization as "Parsing & deserialization" <<group>> package pugixml { } - CSVParser ..|> ParserStrategy - TXTParser ..|> ParserStrategy - XMLParser ..|> ParserStrategy + CSVParser ..|> Parser + TXTParser ..|> Parser + XMLParser ..|> Parser XMLParser -> pugixml - class Deserializer { - + Deserializer(Museum &) + class MuseumDeserializer { + + MuseumDeserializer(Museum &) -- + set_canvas(CanvasData) + set_tile(TileData) @@ -84,9 +84,9 @@ rectangle Group_ParsingDeserialization as "Parsing & deserialization" <<group>> + add_type(type : string, Color, weight : unsigned int) } - CSVParser -up-> Deserializer - XMLParser -up-> Deserializer - TXTParser -up-> Deserializer + CSVParser -up-> MuseumDeserializer + XMLParser -up-> MuseumDeserializer + TXTParser -up-> MuseumDeserializer ' LAYOUT CSVParser -r[hidden] TXTParser @@ -145,7 +145,7 @@ rectangle Group_Model as "Model" <<group>> { class Tile { + data : TileData + color : Color - + behavior : uniq<TileBehaviorStrategy> + + behavior : uniq<TileBehavior> + set_data(TileData &) + set_type(type : const string &) + update() @@ -198,31 +198,31 @@ rectangle Group_TileAppearance as "Tile appearance" <<group>> { green : unsigned int blue : unsigned int } - class TileAppearance { + class TileColorFactory { + get_color(string) : Color <<static>> + register_color(string, Color) <<static>> } Tile --> Color - Color <.. TileAppearance + Color <.. TileColorFactory } rectangle Group_TileBehavior as "Tile behavior" <<group>> { - interface TileBehaviorStrategy { + interface TileBehavior { + step(Artist *) + update(Tile &) - + clone(Museum &) : uniq<TileBehaviorStrategy> + + clone(Museum &) : uniq<TileBehavior> -- - # TileBehaviorStrategy(type : string) - # TileBehaviorStrategy() + # TileBehavior(type : string) + # TileBehavior() -- # interactions : unsigned int # museum : Museum * } - class TileBehavior { - + get_strategy(string) : TileBehaviorStrategy & <<static>> - + register_strategy(string, TileBehaviorStrategy *) <<static>> + class TileBehaviorFactory { + + get_strategy(string) : TileBehavior & <<static>> + + register_strategy(string, TileBehavior *) <<static>> -- - get_collection() : TileBehaviorCollection & <<static>> } @@ -231,35 +231,35 @@ rectangle Group_TileBehavior as "Tile behavior" <<group>> { class NullTileBehavior { - type = "" <<static constexpr>> } - class GrayTileBehavior { + class StepTileBehavior { - type = "G" : <<static constexpr>> } - class RedTileBehavior { + class DeleteArtistTileBehavior { - type = "R" : <<static constexpr>> } - class BlueTileBehavior { + class SetNeighborTileBehavior { - type = "B" : <<static constexpr>> -- - dx : int - dy : int } - class YellowTileBehavior { + class CreateArtistTileBehavior { - type = "Y" : <<static constexpr>> -- - last_interactions : unsigned int } } - TileBehaviorStrategy <|.. NullTileBehavior - TileBehaviorStrategy <|.. GrayTileBehavior - TileBehaviorStrategy <|.. RedTileBehavior - TileBehaviorStrategy <|.. BlueTileBehavior - TileBehaviorStrategy <|.. YellowTileBehavior + TileBehavior <|.. NullTileBehavior + TileBehavior <|.. StepTileBehavior + TileBehavior <|.. DeleteArtistTileBehavior + TileBehavior <|.. SetNeighborTileBehavior + TileBehavior <|.. CreateArtistTileBehavior - Tile --> "state" TileBehavior + Tile --> "state" TileBehaviorFactory - TileBehavior .l> TileBehaviorStrategy - TileBehavior <. TileBehaviorStrategy + TileBehaviorFactory .l> TileBehavior + TileBehaviorFactory <. TileBehavior } } /' LAYOUT '/ @@ -315,28 +315,28 @@ rectangle Group_Commands as "Commands" <<group>> { + Command(museum, view, controller) } - class MuseumPauseCommand { + class ToggleMuseumPauseCommand { + toggle() + set(paused : bool) } class OpenFileGUICommand { + execute() } - class ArtistVisibilityCommand { + class ToggleArtistVisibilityCommand { + toggle() + set(paused : bool) } class LoadFilesCommand { + execute(files) } - class TileDecayCommand { + class StepTileCommand { + execute(x, y) } - Command <|-u- MuseumPauseCommand + Command <|-u- ToggleMuseumPauseCommand Command <|-u- OpenFileGUICommand - Command <|-u- ArtistVisibilityCommand - Command <|-u- TileDecayCommand + Command <|-u- ToggleArtistVisibilityCommand + Command <|-u- StepTileCommand Command <|-d- LoadFilesCommand } } /' LAYOUT '/ @@ -345,8 +345,8 @@ Command .[norank]> Museum Command .[norank]> View Command .[norank]> ViewController -ParserStrategy .l> FileStrategy -Deserializer .l> Museum +Parser .l> FileReader +MuseumDeserializer .l> Museum Museum --> Pathfinding Museum --> Collision @@ -355,7 +355,7 @@ ViewController -[norank]> Command main -d-> Museum main -u-> LoadFilesCommand -' main -[norank]> Deserializer +' main -[norank]> MuseumDeserializer main -[norank]> View main .r> Exception |