From 4cb7ca42003c177e3acc80075d7594e555966106 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Fri, 18 Oct 2024 16:37:02 +0200 Subject: fix command design pattern --- ToggleMuseumPauseCommand.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'ToggleMuseumPauseCommand.h') diff --git a/ToggleMuseumPauseCommand.h b/ToggleMuseumPauseCommand.h index 15d1388..40e0b24 100644 --- a/ToggleMuseumPauseCommand.h +++ b/ToggleMuseumPauseCommand.h @@ -2,11 +2,19 @@ #include "Command.h" +class Museum; + class ToggleMuseumPauseCommand : public Command { - using Command::Command; +public: + ToggleMuseumPauseCommand(Museum & m); + ToggleMuseumPauseCommand(Museum & m, bool set); public: - virtual void toggle(); - virtual void set(bool paused); + virtual void execute(); + +private: + Museum & museum; + bool toggle = true; + bool value; }; -- cgit v1.2.3