ICT290 / src / scene / AIController / BasicEntity.cpp
BasicEntity.cpp
Raw
#include "BasicEntity.h"

// static ID counter set to 0
int BasicEntity::nextID{0};

BasicEntity::BasicEntity(int type,
                         glm::vec2 position,
                         glm::vec2 scale,
                         float boundRadius) {
    nextValidID();
    setType(type);
    setPosition(position);
    setScale(scale);
    setBoundingRadius(boundRadius);
    m_Flag = false;
    EntityMgr->registerEntity(this);
}

void BasicEntity::nextValidID() {
    m_ID = nextID++;
}

int BasicEntity::getID() const {
    return m_ID;
}

int BasicEntity::getType() const {
    return m_Type;
}

void BasicEntity::setType(int type) {
    m_Type = type;
}

glm::vec2 BasicEntity::getPosition() const {
    return m_Position;
}

void BasicEntity::setPosition(glm::vec2 position) {
    m_Position = position;
}

glm::vec2 BasicEntity::getScale() const {
    return m_Scale;
}

void BasicEntity::setScale(glm::vec2 scale) {
    m_Scale = scale;
}

float BasicEntity::getBoundingRadius() const {
    return m_BoundingRadius;
}

void BasicEntity::setBoundingRadius(float radius) {
    m_BoundingRadius = radius;
}

bool BasicEntity::getFlag() const {
    return m_Flag;
}

void BasicEntity::setFlag() {
    m_Flag = true;
}

void BasicEntity::unsetFlag() {
    m_Flag = false;
}