7 #include <QXmlStreamWriter> 31 void load(
const QDomElement& node);
33 void save(QXmlStreamWriter& writer);
98 #endif // ARENAELEMENT_H void saveWorld(QXmlStreamWriter &writer)
Writes .world format-compliant XML.
void saveWorldSdf(QXmlStreamWriter &writer)
ArenaElementType const * type() const
Arena * m_arena
Arena this element currently belongs to (exactly one)
void setItemMountPoint(int mountPoint)
See itemMountPoint(). Use -1 to set index to "unspecified".
int itemMountPoint() const
void setArena(Arena *arena)
Called from Arena::addElement()
void setItemOffset(const QPointF &offset)
See itemOffset()
bool isItem() const
Convenience method returning true iff. this is an item element (freely movable)
QPointF m_itemOffset
See itemOffset()
QPointF itemOffset() const
Returns the item's offset from the grid point with 0 <= x,y <= 1 ( (0,0) is bottom left) ...
int rotation() const
Returns the rotation in degrees.
void save(QXmlStreamWriter &writer)
Serializes this element in XML.
int m_rotation
rotation in degrees (only multiples of 90 degrees)
void load(const QDomElement &node)
Deserializes this element from XML.
void setRotation(int rotation)
Sets the rotation in degrees.
ArenaElement(const ArenaElementType *const type, int id)
Only meant for use by ArenaElementType::createInstance()
QPoint pos() const
Returns the position in arena coordinates.
void setPos(QPoint pos)
Sets the position in arena coordinates.
void rotationChanged(ArenaElement *element, int rotation)
void posChanged(ArenaElement *element, QPoint pos)
bool isFloor() const
Convenience method returning true iff. this is a floor element.
bool isMountableItem() const
Convenience method returning true iff. this is a mountable-item element.
const int m_instanceId
Unique ID set by ArenaElementType.
bool isWall() const
Convenience method returning true iff. this is a wall element.
void modified(ArenaElement *element)
const ArenaElementType *const m_type