Files
Editor2D/include/Format/Entity.hpp

42 lines
880 B
C++

#pragma once
#include <string>
#include <json.hpp>
#include <Color4.hpp>
#include <Re2DLevelAPI.hpp>
enum class EntityRepresentativeShape {
Point, AABB, Sphere, OBB
};
/// @class Entity
/// @brief Represents an object or interactive element placed on the map, not necessarily tied to the tile grid.
/// This can include plater spawn points, enemies, pickups, triggers, boxes (my favorite), or any other
/// game specific object that needs to be placed and configured in the level.
class Entity
{
public:
#pragma region json properties
std::string name;
std::string type;
float x;
float y;
float width;
float height;
float rotation;
float flip_h;
float flip_v;
int z_index;
Color4 overlay_color;
json::value metadata;
#pragma endregion
Entity();
Entity(const json::value& json);
json::value Serialize() const;
void Deserialize(const json::value& json);
};