summaryrefslogtreecommitdiffstats
path: root/sigmod/MapEffect.cpp
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-12-27 00:55:58 -0500
committerBen Boeckel <MathStuf@gmail.com>2008-12-27 00:55:58 -0500
commitbbcfec59afb468601dfe0ac227bab9ce71a3e160 (patch)
tree4f52a44fece93dd91b8d716db788195f9b0984f5 /sigmod/MapEffect.cpp
parent192a263e7db99cf0b2c9b61f65ae07b53ab28d7a (diff)
downloadsigen-bbcfec59afb468601dfe0ac227bab9ce71a3e160.tar.gz
sigen-bbcfec59afb468601dfe0ac227bab9ce71a3e160.tar.xz
sigen-bbcfec59afb468601dfe0ac227bab9ce71a3e160.zip
Migrated more classes to using the check structure
Diffstat (limited to 'sigmod/MapEffect.cpp')
-rw-r--r--sigmod/MapEffect.cpp75
1 files changed, 20 insertions, 55 deletions
diff --git a/sigmod/MapEffect.cpp b/sigmod/MapEffect.cpp
index 4a16bc06..241a7ce3 100644
--- a/sigmod/MapEffect.cpp
+++ b/sigmod/MapEffect.cpp
@@ -83,62 +83,27 @@ QDomElement Sigmod::MapEffect::save() const
return xml;
}
-void Sigmod::MapEffect::setName(const QString& name)
-{
- CHECK(name);
-}
-
-void Sigmod::MapEffect::setCoordinate(const QPoint& coordinate)
-{
+SETTER(MapEffect, QString&, Name, name)
+SETTER(MapEffect, QPoint&, Coordinate, coordinate)
+SETTER(MapEffect, int, Skin, skin)
+SETTER(MapEffect, bool, IsGhost, isGhost)
+SETTER(MapEffect, Sigcore::Script&, Script, script)
+
+GETTER(MapEffect, QString, name)
+GETTER(MapEffect, QPoint, coordinate)
+GETTER(MapEffect, int, skin)
+GETTER(MapEffect, bool, isGhost)
+GETTER(MapEffect, Sigcore::Script, script)
+
+CHECK(MapEffect, QString&, name)
+CHECK_BEGIN(MapEffect, QPoint&, coordinate)
const Map* map = qobject_cast<const Map*>(parent());
- if ((coordinate.x() < 0) || (coordinate.y() < 0) || (map->width() <= coordinate.x()) || (map->height() <= coordinate.y()))
- emit(error(bounds("coordinate", QPoint(0, 0), QPoint(map->width(), map->height()), coordinate)));
- else
- CHECK(coordinate);
-}
-
-void Sigmod::MapEffect::setSkin(const int skin)
-{
- if (!sigmod()->skinById(skin))
- emit(error(bounds("skin", skin)));
- else
- CHECK(skin);
-}
-
-void Sigmod::MapEffect::setIsGhost(const bool isGhost)
-{
- CHECK(isGhost);
-}
-
-void Sigmod::MapEffect::setScript(const Sigcore::Script& script)
-{
- CHECK(script);
-}
-
-QString Sigmod::MapEffect::name() const
-{
- return m_name;
-}
-
-QPoint Sigmod::MapEffect::coordinate() const
-{
- return m_coordinate;
-}
-
-int Sigmod::MapEffect::skin() const
-{
- return m_skin;
-}
-
-bool Sigmod::MapEffect::isGhost() const
-{
- return m_isGhost;
-}
-
-Sigcore::Script Sigmod::MapEffect::script() const
-{
- return m_script;
-}
+ TBOUNDS_MOD(coordinate_x, 0, map->width() - 1, coordinate.x())
+ TBOUNDS_MOD(coordinate_y, 0, map->height() - 1, coordinate.y())
+CHECK_END()
+CHECK_INDEX(MapEffect, int, skin, sigmod(), skin)
+CHECK(MapEffect, bool, isGhost)
+CHECK(MapEffect, Sigcore::Script&, script)
Sigmod::MapEffect& Sigmod::MapEffect::operator=(const MapEffect& rhs)
{