Implemented entity.GetType() in lua
This will only work for userdata decented from the Entity base class. Using something else results in undefined behavior.
This commit is contained in:
@@ -21,6 +21,10 @@
|
||||
*/
|
||||
#include "entity.hpp"
|
||||
|
||||
Entity::Entity(const char* _type): type(_type) {
|
||||
//EMPTY
|
||||
}
|
||||
|
||||
void Entity::Update() {
|
||||
origin += motion;
|
||||
}
|
||||
@@ -55,4 +59,8 @@ Vector2 Entity::GetMotion() const {
|
||||
|
||||
BoundingBox Entity::GetBounds() const {
|
||||
return bounds;
|
||||
}
|
||||
|
||||
const char* Entity::GetType() const {
|
||||
return type;
|
||||
}
|
||||
Reference in New Issue
Block a user