Lua work on api - entity and mob, lots more to go

This commit is contained in:
KimLS
2013-05-11 13:51:57 -07:00
parent d1f7935ee2
commit fa908040ca
10 changed files with 292 additions and 13 deletions
+12
View File
@@ -3,6 +3,8 @@
#include "masterentity.h"
#include "lua_entity.h"
#include "lua_mob.h"
#include "lua_client.h"
#include "lua_npc.h"
bool Lua_Entity::IsClient() {
Entity *ent = reinterpret_cast<Entity*>(d_);
@@ -64,6 +66,16 @@ int Lua_Entity::GetID() {
return ent->GetID();
}
Lua_Client Lua_Entity::CastToClient() {
Client *m = reinterpret_cast<Client*>(d_);
return Lua_Client(m);
}
Lua_NPC Lua_Entity::CastToNPC() {
NPC *m = reinterpret_cast<NPC*>(d_);
return Lua_NPC(m);
}
Lua_Mob Lua_Entity::CastToMob() {
Mob *m = reinterpret_cast<Mob*>(d_);
return Lua_Mob(m);