From 76e61d68bbf568ec0d7fc4632e52d4de5496b003 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Fri, 18 Oct 2024 15:43:25 +0200 Subject: (1/2) rename --- docs/class-diag.puml | 122 +++++++++++++++++++++++++-------------------------- 1 file changed, 61 insertions(+), 61 deletions(-) (limited to 'docs') 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" <> { - class FileReader <> { - +open(url) : FileStrategy& + class FileReaderFactory <> { + +open(url) : FileReader& } - interface FileStrategy { + interface FileReader { + read() : string + close() -- # open(string url) - # clone() : FileStrategy* <> + # clone() : FileReader* <> } - class LocalFile { - - instance : LocalFile <> + class LocalFileReader { + - instance : LocalFileReader <> } - class HTTPFile { - - instance : HTTPFile <> + class HTTPFileReader { + - instance : HTTPFileReader <> } 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" <> { - class Parser { - + parse(FileStrategy &, Deserializer &) <> - + register_strategy(ParserStrategy *) <> + class ParserFactory { + + parse(FileReader &, MuseumDeserializer &) <> + + register_strategy(Parser *) <> -- - get_collection() : ParserCollection <> } - interface ParserStrategy { - + parse(FileStrategy &, Deserializer &) <> - + heuristic(FileStrategy &) : unsigned int <> + interface Parser { + + parse(FileReader &, MuseumDeserializer &) <> + + heuristic(FileReader &) : unsigned int <> } - ParserStrategy .> Parser - ParserStrategy <. Parser + Parser .> ParserFactory + Parser <. ParserFactory class CSVParser class XMLParser @@ -69,14 +69,14 @@ rectangle Group_ParsingDeserialization as "Parsing & deserialization" <> 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" <> + 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" <> { class Tile { + data : TileData + color : Color - + behavior : uniq + + behavior : uniq + set_data(TileData &) + set_type(type : const string &) + update() @@ -198,31 +198,31 @@ rectangle Group_TileAppearance as "Tile appearance" <> { green : unsigned int blue : unsigned int } - class TileAppearance { + class TileColorFactory { + get_color(string) : Color <> + register_color(string, Color) <> } Tile --> Color - Color <.. TileAppearance + Color <.. TileColorFactory } rectangle Group_TileBehavior as "Tile behavior" <> { - interface TileBehaviorStrategy { + interface TileBehavior { + step(Artist *) + update(Tile &) - + clone(Museum &) : uniq + + clone(Museum &) : uniq -- - # TileBehaviorStrategy(type : string) - # TileBehaviorStrategy() + # TileBehavior(type : string) + # TileBehavior() -- # interactions : unsigned int # museum : Museum * } - class TileBehavior { - + get_strategy(string) : TileBehaviorStrategy & <> - + register_strategy(string, TileBehaviorStrategy *) <> + class TileBehaviorFactory { + + get_strategy(string) : TileBehavior & <> + + register_strategy(string, TileBehavior *) <> -- - get_collection() : TileBehaviorCollection & <> } @@ -231,35 +231,35 @@ rectangle Group_TileBehavior as "Tile behavior" <> { class NullTileBehavior { - type = "" <> } - class GrayTileBehavior { + class StepTileBehavior { - type = "G" : <> } - class RedTileBehavior { + class DeleteArtistTileBehavior { - type = "R" : <> } - class BlueTileBehavior { + class SetNeighborTileBehavior { - type = "B" : <> -- - dx : int - dy : int } - class YellowTileBehavior { + class CreateArtistTileBehavior { - type = "Y" : <> -- - 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" <> { + 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 -- cgit v1.2.3