Advertisement
robn

Untitled

Mar 22nd, 2011
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.95 KB | None | 0 0
  1. #include "StarSystem.h"
  2.  
  3. class UncopyableSBodyPath : public SBodyPath, public DeleteEmitter {
  4. public:
  5.     UncopyableSBodyPath(const SBodyPath &p) : SBodyPath(p), DeleteEmitter() {}
  6. };
  7.  
  8. template <>
  9. class LuaSubObject<UncopyableSBodyPath> : public LuaSubObject< LuaSubObject<UncopyableSBodyPath> > {
  10. public:
  11.     static inline LuaObject *PushToLua(SBodyPath *p) {
  12.         UncopyableSBodyPath *up = new UncopyableSBodyPath(*p);
  13.         delete p;
  14.         return LuaSubObject<UncopyableSBodyPath>::PushToLua(up);
  15.     }
  16.  
  17.     static inline LuaObject *PushToLuaGC(SBodyPath *p) {
  18.         UncopyableSBodyPath *up = new UncopyableSBodyPath(*p);
  19.         delete p;
  20.         return LuaSubObject<UncopyableSBodyPath>::PushToLuaGC(up);
  21.     }
  22.  
  23.     static inline SBodyPath *PullFromLua() {
  24.         return dynamic_cast<SBodyPath*>(LuaSubObject<UncopyableSBodyPath>::PullFromLua());
  25.     }
  26. };
  27.  
  28. typedef LuaSubObject< LuaSubObject<UncopyableSBodyPath> > LuaSBodyPath;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement