diff options
Diffstat (limited to 'sigencore/Client.cpp')
| -rw-r--r-- | sigencore/Client.cpp | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/sigencore/Client.cpp b/sigencore/Client.cpp index 5cbbca9b..b4cb2007 100644 --- a/sigencore/Client.cpp +++ b/sigencore/Client.cpp @@ -18,6 +18,9 @@ // Header include #include "Client.h" +// Sigencore includes +#include "Canvas.h" + using namespace Sigscript; using namespace Sigencore; @@ -25,8 +28,7 @@ Client::Client(GameWrapper* game, Config* parent) : Config(parent), m_game(game), m_arena(NULL), - m_world(NULL), - m_canvas(NULL) + m_world(NULL) { } @@ -66,7 +68,25 @@ void Client::exitWorld() m_world = NULL; } -Canvas* Client::canvas() +bool Client::addCanvas(const QString& name, Canvas* canvas) +{ + if (!m_canvases.contains(name)) + { + m_canvases[name] = canvas; + return true; + } + return false; +} + +void Client::removeCanvas(const QString& canvas) +{ + if (m_canvases.contains(canvas)) + m_canvases[canvas]->cleanup(); +} + +Canvas* Client::canvas(const QString& canvas) { - return m_canvas; + if (m_canvases.contains(canvas)) + return m_canvases[canvas]; + return NULL; } |
