From 157f77d6356f4fc2be209f879907f4289c8c511d Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Tue, 15 Oct 2024 19:41:41 +0200 Subject: fix layout + add pathfinding and collision classes --- docs/class-diag.puml | 125 ++++++++++++++++++++++++++------------------------- 1 file changed, 65 insertions(+), 60 deletions(-) (limited to 'docs') diff --git a/docs/class-diag.puml b/docs/class-diag.puml index 389395a..e0f10c1 100644 --- a/docs/class-diag.puml +++ b/docs/class-diag.puml @@ -37,16 +37,16 @@ rectangle Group_FileReading as "File reading" <> { } package CPR { } - FileStrategy <|.. LocalFile - FileStrategy <|.. HTTPFile + FileStrategy <|.u. LocalFile + FileStrategy <|.u. HTTPFile + FileStrategy .l> FileReader FileStrategy <. FileReader - FileStrategy .> FileReader - HTTPFile -> CPR + HTTPFile -l> CPR ' LAYOUT - LocalFile -r[hidden] HTTPFile + HTTPFile -r[hidden] LocalFile } rectangle Group_ParsingDeserialization as "Parsing & deserialization" <> { class Parser { @@ -95,6 +95,15 @@ rectangle Group_ParsingDeserialization as "Parsing & deserialization" <> } /' LAYOUT '/ together { /' LAYOUT '/ +rectangle Group_Algorithms as "Algorithms" <> { + class Pathfinding { + + Pathfinding(Museum &) + } + class Collision { + + Collision(Museum &) + } + +} rectangle Group_Model as "Model" <> { class Museum { + people : People @@ -242,20 +251,13 @@ rectangle Group_TileBehavior as "Tile behavior" <> { -- - last_interactions : unsigned int } - - ' LAYOUT - TileBehavior -d[hidden]- NullTileBehavior - NullTileBehavior -d[hidden]- GrayTileBehavior - GrayTileBehavior -d[hidden]- RedTileBehavior - RedTileBehavior -d[hidden]- BlueTileBehavior - BlueTileBehavior -d[hidden]- YellowTileBehavior } - TileBehaviorStrategy <|.[norank]. NullTileBehavior - TileBehaviorStrategy <|.[norank]. GrayTileBehavior - TileBehaviorStrategy <|.[norank]. RedTileBehavior - TileBehaviorStrategy <|.[norank]. BlueTileBehavior - TileBehaviorStrategy <|.[norank]. YellowTileBehavior + TileBehaviorStrategy <|.. NullTileBehavior + TileBehaviorStrategy <|.. GrayTileBehavior + TileBehaviorStrategy <|.. RedTileBehavior + TileBehaviorStrategy <|.. BlueTileBehavior + TileBehaviorStrategy <|.. YellowTileBehavior Tile --> "state" TileBehavior @@ -265,40 +267,6 @@ rectangle Group_TileBehavior as "Tile behavior" <> { } /' LAYOUT '/ together { /' LAYOUT '/ -rectangle Group_Commands as "Commands" <> { - class Command { - # museum : Museum& - # view : View& - # controller : ViewController& - -- - + Command(command : const Command *) - + Command(museum, view, controller) - } - - class MuseumPauseCommand { - + toggle() - + set(paused : bool) - } - class OpenFileGUICommand { - + execute() - } - class ArtistVisibilityCommand { - + toggle() - + set(paused : bool) - } - class LoadFilesCommand { - + execute(files) - } - class TileDecayCommand { - + execute(x, y) - } - - Command <|-u- MuseumPauseCommand - Command <|-u- OpenFileGUICommand - Command <|-u- ArtistVisibilityCommand - Command <|-u- TileDecayCommand - Command <|-d- LoadFilesCommand -} rectangle Group_Visualization as "Visualization" <> { struct Rectangle { x : unsigned int @@ -336,9 +304,43 @@ rectangle Group_Visualization as "Visualization" <> { ViewController <-- View View --> SDL3 - View .> Rectangle - ViewController .> KeyboardCode - ViewController .> MouseCode + View .l> Rectangle + ViewController .l> KeyboardCode + ViewController .l> MouseCode +} +rectangle Group_Commands as "Commands" <> { + class Command { + # museum : Museum& + # view : View& + # controller : ViewController& + -- + + Command(command : const Command *) + + Command(museum, view, controller) + } + + class MuseumPauseCommand { + + toggle() + + set(paused : bool) + } + class OpenFileGUICommand { + + execute() + } + class ArtistVisibilityCommand { + + toggle() + + set(paused : bool) + } + class LoadFilesCommand { + + execute(files) + } + class TileDecayCommand { + + execute(x, y) + } + + Command <|-u- MuseumPauseCommand + Command <|-u- OpenFileGUICommand + Command <|-u- ArtistVisibilityCommand + Command <|-u- TileDecayCommand + Command <|-d- LoadFilesCommand } } /' LAYOUT '/ @@ -346,21 +348,24 @@ Command .[norank]> Museum Command .[norank]> View Command .[norank]> ViewController -ParserStrategy ..> FileStrategy -Deserializer .> Museum +ParserStrategy .l> FileStrategy +Deserializer .l> Museum + +Museum --> Pathfinding +Museum --> Collision ViewController -[norank]> Command main -d-> Museum main -u-> LoadFilesCommand -main -[norank]> Deserializer +' main -[norank]> Deserializer main -[norank]> View -main .l> Exception +main .r> Exception ' LAYOUT Group_TileBehavior -r[hidden] Group_TileAppearance -Group_Model -r[hidden] Group_ParsingDeserialization -Group_Commands -r[hidden] Group_Visualization +Group_ParsingDeserialization -r[hidden] Group_Model +' Collision -r[hidden] People @enduml -- cgit v1.2.3