aboutsummaryrefslogtreecommitdiff
path: root/docs/class-diag.puml
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-10-18 16:37:02 +0200
committerLoek Le Blansch <loek@pipeframe.xyz>2024-10-18 16:37:02 +0200
commit4cb7ca42003c177e3acc80075d7594e555966106 (patch)
treed2f5836d70a1fa2dc1d18c4fb59f1bf1f2f91f5a /docs/class-diag.puml
parentd8289105193707daede1a5b59137f18e20f20aeb (diff)
fix command design pattern
Diffstat (limited to 'docs/class-diag.puml')
-rw-r--r--docs/class-diag.puml55
1 files changed, 34 insertions, 21 deletions
diff --git a/docs/class-diag.puml b/docs/class-diag.puml
index a6fc1cf..56a334f 100644
--- a/docs/class-diag.puml
+++ b/docs/class-diag.puml
@@ -294,7 +294,6 @@ rectangle Group_Visualization as "Visualization" <<group>> {
+ ev_mousemove(x, y);
--
- draw_artists : bool <<+get>> <<+set>>
- - cmd_base : const Command *
}
ViewController ..> View
@@ -306,45 +305,59 @@ rectangle Group_Visualization as "Visualization" <<group>> {
ViewController .l> MouseCode
}
rectangle Group_Commands as "Commands" <<group>> {
- class Command {
- # museum : Museum * <<+get&>> <<-set>>
- # view : View * <<+get&>> <<-set>>
- # controller : ViewController * <<+get&>> <<-set>>
- --
- + Command(command : const Command *)
- + Command(museum, view, controller)
+ interface Command {
+ + execute()
}
class ToggleMuseumPauseCommand {
- + toggle()
- + set(paused : bool)
+ + constructor(Museum &)
+ + constructor(Museum &, set : bool)
+ --
+ toggle : bool
+ value : bool
}
class OpenFileGUICommand {
- + execute()
+ + constructor(Museum &, View &)
+ --
+ - museum : Museum &
+ - view : View &
}
class ToggleArtistVisibilityCommand {
- + toggle()
- + set(paused : bool)
+ + constructor(ViewController &)
+ --
+ - controller : ViewController &
}
class LoadFilesCommand {
- + execute(files)
+ + constructor(Museum &, files : vec<string>)
+ + constructor(Museum &, argc, argv)
+ --
+ - load_files()
+ - museum : Museum &
+ - files : vec<string>
}
class StepTileCommand {
- + execute(x, y)
+ + constructor(Canvas &, pair<x, y>)
+ --
+ - canvas : Canvas &
+ - x : unsigned int
+ - y : unsigned int
+ }
+ class TimeTravelCommand {
+ + constructor(Museum &, forwards : bool)
+ --
+ - museum : Museum &
+ - forwards : bool
}
- Command <|-u- ToggleMuseumPauseCommand
+ Command <|-d- ToggleMuseumPauseCommand
Command <|-u- OpenFileGUICommand
Command <|-u- ToggleArtistVisibilityCommand
- Command <|-u- StepTileCommand
+ Command <|-d- StepTileCommand
Command <|-d- LoadFilesCommand
+ Command <|-d- TimeTravelCommand
}
} /' LAYOUT '/
-Command .[norank]> Museum
-Command .[norank]> View
-Command .[norank]> ViewController
-
Parser .l> FileReader
MuseumDeserializer .l> Museum