diff options
Diffstat (limited to 'src/mapentity.h')
-rw-r--r-- | src/mapentity.h | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/src/mapentity.h b/src/mapentity.h new file mode 100644 index 0000000..788e02d --- /dev/null +++ b/src/mapentity.h @@ -0,0 +1,94 @@ +/* + mapentity.h + This file is part of the Project::OSiRiON world editor + and is distributed under the terms and conditions of + the GNU General Public License version 2 +*/ + +#ifndef __INCLUDED_EDITOR_MAPENTITY__ +#define __INCLUDED_EDITOR_MAPENTITY__ + +#include <QWidget> +#include <QList> +#include <QString> + +namespace editor +{ + +/** + * @brief MapEntity is an entity on the map + * */ +class MapEntity : public QWidget +{ + Q_OBJECT + +public: + MapEntity(QWidget *parent = 0); + + /** + * @brief returns the entity label + * */ + inline const QString &label() const { + return entity_label; + } + + /** + * @brief returns the entity name + * */ + inline const QString &name() const { + return entity_name; + } + + /** + * @brief returns the entity radius + * */ + inline const float radius() const { + return entity_radius; + } + + /** + * @brief returns the x, y, or z coordinate of the entity location + * */ + inline const float location(int index) const { + return entity_location[index]; + } + +public slots: + + /** + * @brief set the entity name + * */ + void set_label(const QString &label); + + /** + * @brief set the entity label + * */ + void set_name(const QString &name); + + /** + * @brief set the entity radius + * */ + void set_radius(const float radius); + + /** + * @brief set the entity location + * */ + void set_location(const float x, const float y, const float z); + +protected: + virtual void paintEvent(QPaintEvent *event); + +private: + QString entity_label; + QString entity_name; + QString entity_type; + + float entity_location[3]; + float entity_radius; + + QColor entity_color; +}; + +} + +#endif // __INCLUDED_EDITOR_MAPENTITY__
\ No newline at end of file |