CapsAdmin

Untitled

Mar 28th, 2011
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. #include "StdAfx.h"
  2. #include "lua\init.hpp"
  3.  
  4. #include "luaobj_IEntity.hpp"
  5.  
  6. #include "lua\sugar\object_reg.hpp"
  7.  
  8. Setup(IEntity, entity)
  9.  
  10.     function(__tostring)
  11.         lua_pushfstring(L, "entity[%d][%s]", self->GetId(), self->GetClass()->GetName());
  12.     end
  13.  
  14.     function(__len)
  15.         lua_pushnumber(L, self->GetId());
  16.     end
  17.  
  18.     function(GetClass)
  19.         lua_pushstring(L, self->GetClass()->GetName());
  20.     end
  21.  
  22.     function(Remove)
  23.         gEnv->pEntitySystem->RemoveEntity(self->GetId(), true);
  24.     end0
  25.  
  26.     function(SetSize)
  27.         self->SetScale(Vec3(1,1,1) * lua_tonumber(L, 2));
  28.     ends
  29.  
  30. Functions
  31.  
  32.     R(SetSize)
  33.  
  34.     RR(Remove, Remove)
  35.     RR(Delete, Remove)
  36.     RR(Destory, Remove)
  37.  
  38.     R(__tostring)
  39.     R(__len)
  40.     R(__index)
  41.     R(__newindex)
  42.     R(__eq)
  43.  
  44. Register
Advertisement
Add Comment
Please, Sign In to add comment