arena.h
Go to the documentation of this file.
1 #ifndef ARENA_H
2 #define ARENA_H
3 
4 #include <QObject>
5 #include <QPoint>
6 
7 class ArenaElement;
9 
10 class Arena : public QObject
11 {
12  Q_OBJECT
13 
14 public:
15  Arena(ArenaElementTypeRegistry* typeRegistry);
16  ~Arena();
17 
19  void load(const QString& filename);
21  void save(const QString& filename);
23  void saveWorld(const QString& filename);
24  void saveWorldSdf(const QString& filename);
25 
27  ArenaElement* addElement(const QString& elementType);
29  void addElement(ArenaElement *element);
32  void removeElement(ArenaElement* element);
33 
35  void clear();
36 
37  QList<ArenaElement*> elements() { return m_elements; }
38  QList<ArenaElement*> elementsAt(const QPoint &pos) const;
39 
42  ArenaElement *contextElement(ArenaElement *element) const;
43 
44 signals:
45  void elementAdded(ArenaElement *element);
46  void elementRemoved(ArenaElement *element);
47 
48  void modified();
49 
50 private slots:
51  void slotModified();
52 
53 private:
55  QList<ArenaElement*> m_elements;
56 };
57 
58 #endif // ARENA_H
void modified()
void removeElement(ArenaElement *element)
Definition: arena.cpp:461
void clear()
Removes all elements from this arena.
Definition: arena.cpp:469
void slotModified()
Definition: arena.cpp:439
void saveWorld(const QString &filename)
Writes .world format-compliant XML.
Definition: arena.cpp:112
void load(const QString &filename)
Deserializes this arena from XML.
Definition: arena.cpp:24
QList< ArenaElement * > elementsAt(const QPoint &pos) const
Definition: arena.cpp:489
~Arena()
Definition: arena.cpp:20
ArenaElementTypeRegistry *const m_typeRegistry
Definition: arena.h:54
ArenaElement * contextElement(ArenaElement *element) const
Definition: arena.cpp:498
Definition: arena.h:10
ArenaElement * addElement(const QString &elementType)
Creates and adds an element of type elementType.
Definition: arena.cpp:481
Arena(ArenaElementTypeRegistry *typeRegistry)
Definition: arena.cpp:15
void elementRemoved(ArenaElement *element)
void saveWorldSdf(const QString &filename)
Definition: arena.cpp:263
QList< ArenaElement * > elements()
Definition: arena.h:37
void elementAdded(ArenaElement *element)
QList< ArenaElement * > m_elements
Definition: arena.h:55
void save(const QString &filename)
Serializes this arena in XML.
Definition: arena.cpp:88


hector_nist_arena_designer
Author(s): Stefan Kohlbrecher , Johannes Simon
autogenerated on Fri Aug 21 2020 10:45:27