29 lines
887 B
C++
29 lines
887 B
C++
#include "game/entities/entity.hpp"
|
|
|
|
#include <utility>
|
|
|
|
Entity::Entity(std::string name, TilePos tile, SDL_FRect pixel_rect)
|
|
: name_(std::move(name)),
|
|
tile_(tile),
|
|
pixel_rect_(pixel_rect) {}
|
|
|
|
void Entity::update(float delta_time) {
|
|
if (anim_.has_value()) { anim_->tick(delta_time); }
|
|
}
|
|
|
|
void Entity::render() {
|
|
// No-op de base. El dibuix real el fa `EntityManager::renderAll` (viu
|
|
// a `entity_manager_loadlevel.cpp`, que sí depèn de `Surface`). Així
|
|
// `entity.cpp` no arrossega el pipeline de render al smoke test
|
|
// stand-alone. Les subclasses futures poden sobreescriure si volen
|
|
// lògica pròpia (p.ex. render condicional segons estat).
|
|
}
|
|
|
|
void Entity::onPlayerContact(Player* /*player*/) {
|
|
// No-op per defecte.
|
|
}
|
|
|
|
void Entity::notifyTileEntered(int /*col*/, int /*row*/) {
|
|
// No-op per defecte; només `Sarcophagus` l'usa.
|
|
}
|