/** GDevelop - Physics Behavior Extension Copyright (c) 2010-2016 Florian Rival (Florian.Rival@gmail.com) This project is released under the MIT License. */ #pragma once #include #include #include #include "GDCore/Project/Behavior.h" #include "GDCore/Project/Object.h" #include "GDCore/Vector2.h" namespace gd { class Project; class SerializerElement; } // namespace gd class GD_EXTENSION_API PhysicsBehavior : public gd::Behavior { public: PhysicsBehavior(){}; virtual ~PhysicsBehavior(){}; virtual std::unique_ptr Clone() const override { return gd::make_unique(*this); } enum Positioning { OnOrigin = 0, OnCenter = 2 }; virtual std::map GetProperties( const gd::SerializerElement &behaviorContent) const override; virtual bool UpdateProperty(gd::SerializerElement &behaviorContent, const gd::String &name, const gd::String &value) override; /** * Serialize the behavior */ virtual void InitializeContent( gd::SerializerElement &behaviorContent) override; private: gd::String GetStringFromCoordsVector(const std::vector &vec, char32_t coordsSep, char32_t composantSep); enum ShapeType { Box, Circle, CustomPolygon } shapeType; ///< the kind of hitbox -> Box, Circle or CustomPolygon };