#pragma once

#include <vector>
#include <string>
#include <nlohmann/json.hpp>

using json = nlohmann::json;

namespace warfactory {

class IAttachedElement {
public:
    virtual ~IAttachedElement() = default;

    virtual int getElementId() const = 0;

    virtual float getX() const = 0;
    virtual float getY() const = 0;

    virtual float getMass() const = 0;
    virtual float getRadius() const = 0;

    virtual std::string getElementType() const = 0;

    virtual std::vector<int> getAttachedToElements() const = 0;
    virtual void attachToElement(int element_id) = 0;
    virtual void detachFromElement(int element_id) = 0;
    virtual bool isAttachedTo(int element_id) const = 0;

    virtual json serialize() const = 0;
    virtual void deserialize(const json& data) = 0;
};

} // namespace warfactory