diff options
Diffstat (limited to 'sigmod/Tile.cpp')
-rw-r--r-- | sigmod/Tile.cpp | 41 |
1 files changed, 2 insertions, 39 deletions
diff --git a/sigmod/Tile.cpp b/sigmod/Tile.cpp index 56215332..3646dbd3 100644 --- a/sigmod/Tile.cpp +++ b/sigmod/Tile.cpp @@ -21,7 +21,6 @@ // Sigmod includes #include "Macros.h" #include "Sigmod.h" -#include "Sprite.h" Sigmod::Tile::Tile(const Tile& tile) : Object(tile.parent(), tile.id()) @@ -32,24 +31,18 @@ Sigmod::Tile::Tile(const Tile& tile) : Sigmod::Tile::Tile(const Sigmod* parent, const int id) : Object(parent, id), m_name(""), - m_sprite(-1), - m_from(D_Right - D_Up + 1), m_script("", "") { - for (int i = 0; i < m_from.size(); ++i) - m_from[i] = false; } Sigmod::Tile::Tile(const Tile& tile, const Sigmod* parent, const int id) : - Object(parent, id), - m_from(D_Right - D_Up + 1) + Object(parent, id) { *this = tile; } Sigmod::Tile::Tile(const QDomElement& xml, const Sigmod* parent, const int id) : - Object(parent, id), - m_from(D_Right - D_Up + 1) + Object(parent, id) { LOAD_ID(); load(xml); @@ -60,7 +53,6 @@ void Sigmod::Tile::validate() TEST_BEGIN(); if (m_name.isEmpty()) emit(error("Name is empty")); - TEST(setSprite, sprite); TEST_END(); } @@ -68,8 +60,6 @@ void Sigmod::Tile::load(const QDomElement& xml) { LOAD_BEGIN(); LOAD(name); - LOAD(sprite); - LOAD_ARRAY(from); LOAD(script); } @@ -77,8 +67,6 @@ QDomElement Sigmod::Tile::save() const { SAVE_CREATE(); SAVE(name); - SAVE(sprite); - SAVE_ARRAY(from); SAVE(script); return xml; } @@ -88,19 +76,6 @@ void Sigmod::Tile::setName(const QString& name) CHECK(name); } -void Sigmod::Tile::setSprite(const int sprite) -{ - if (qobject_cast<const Sigmod*>(sigmod())->spriteIndex(sprite) == INT_MAX) - emit(error(bounds("sprite"))); - else - CHECK(sprite); -} - -void Sigmod::Tile::setFrom(const Direction direction, const bool state) -{ - CHECK_ARRAY(from[direction], state); -} - void Sigmod::Tile::setScript(const Sigcore::Script& script) { CHECK(script); @@ -111,16 +86,6 @@ QString Sigmod::Tile::name() const return m_name; } -int Sigmod::Tile::sprite() const -{ - return m_sprite; -} - -bool Sigmod::Tile::from(const Direction direction) const -{ - return m_from[direction]; -} - Sigcore::Script Sigmod::Tile::script() const { return m_script; @@ -131,8 +96,6 @@ Sigmod::Tile& Sigmod::Tile::operator=(const Tile& rhs) if (this == &rhs) return *this; COPY(name); - COPY(sprite); - COPY(from); COPY(script); return *this; } |