mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 15:53:42 +00:00
31 lines
467 B
C++
31 lines
467 B
C++
#include "Entity.h"
|
|
|
|
#include "Manager.h"
|
|
#include "Component.h"
|
|
|
|
void Entity::update() const
|
|
{
|
|
for (auto const& c : components) c->update();
|
|
}
|
|
|
|
void Entity::draw() const
|
|
{
|
|
for (auto const& c : components) c->draw();
|
|
}
|
|
|
|
bool Entity::hasGroup(Group mGroup)
|
|
{
|
|
return groupBitSet[mGroup];
|
|
}
|
|
|
|
void Entity::addGroup(Group mGroup)
|
|
{
|
|
groupBitSet[mGroup] = true;
|
|
manager.addToGroup(this, mGroup);
|
|
}
|
|
|
|
void Entity::delGroup(Group mGroup)
|
|
{
|
|
groupBitSet[mGroup] = false;
|
|
}
|