diff options
Diffstat (limited to 'Deserializer.cpp')
-rw-r--r-- | Deserializer.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Deserializer.cpp b/Deserializer.cpp new file mode 100644 index 0000000..ecadbbe --- /dev/null +++ b/Deserializer.cpp @@ -0,0 +1,32 @@ +#include "Deserializer.h" +#include "Exception.h" + +void Deserializer::set_target(Museum * museum) { + this->museum = museum; +} + +Museum & Deserializer::get_target() { + if (this->museum == nullptr) + throw Exception("no museum given to Deserializer"); + + return *this->museum; +} + +void Deserializer::add_artist(ArtistData data) { + Museum & museum = this->get_target(); + // museum.people.add_artist(data); + printf("add artist(%1.2f, %1.2f)...\n", data.x, data.y); +} + +void Deserializer::set_canvas(CanvasData data) { + Museum & museum = this->get_target(); + // museum.canvas.data = data; + printf("set canvas(%dx%d)...\n", data.rows, data.columns); +} + +void Deserializer::add_tile(unsigned int x, unsigned int y, TileData data) { + Museum & museum = this->get_target(); + // museum.canvas.set_tile(x, y, data); + printf("add tile(%d,%d) data(%s)...\n", x, y, data.type.c_str()); +} + |