diff options
Diffstat (limited to 'Command.cpp')
-rw-r--r-- | Command.cpp | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/Command.cpp b/Command.cpp deleted file mode 100644 index f497f0f..0000000 --- a/Command.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "Command.h" -#include "Exception.h" - -Command::Command(const Command * c) { - this->set_museum(*c->museum); - this->set_view(*c->view); - this->set_controller(*c->controller); -} - -Command::Command(Museum & m, View & v, ViewController & c) { - this->set_museum(m); - this->set_view(v); - this->set_controller(c); -} - -Command::Command(Museum & m, View & v) { - this->set_museum(m); - this->set_view(v); -} - -Command::Command(Museum & m) { - this->set_museum(m); -} - -Museum & Command::get_museum() { - if (this->museum == nullptr) - throw Exception("Command error: command needs museum"); - return *this->museum; -} - -View & Command::get_view() { - if (this->view == nullptr) - throw Exception("Command error: command needs view"); - return *this->view; -} - -ViewController & Command::get_controller() { - if (this->controller == nullptr) - throw Exception("Command error: command needs controller"); - return *this->controller; -} - -void Command::set_museum(Museum & museum) { - this->museum = &museum; -} - -void Command::set_view(View & view) { - this->view = &view; -} - -void Command::set_controller(ViewController & controller) { - this->controller = &controller; -} - |