#pragma once

#include <common.h>
#include "level.h"
#include "cell.h"
#include <vector>

namespace game{

class entity
{
public:
    entity(const vec2u &pos, const vec2u &size, level*);
    virtual ~entity() = default;

    virtual void update() = 0;
    virtual void draw() = 0;

    virtual void onCellDestroyed();
    virtual void onNeighbourCreated(entity*) = 0;
    virtual void beforeNeighbourDestroyed(entity*) = 0;

    virtual void destroy();
protected:

    virtual void _placeOnMap();

    level *_root;
    std::vector<cell*> _cells;

    vec2u _pos;
    vec2u _size = vec2u(1);
};

}
