Index: branches/script_engine/src/lib/script_engine/Account.cc
===================================================================
--- branches/script_engine/src/lib/script_engine/Account.cc	(revision 8248)
+++ 	(revision )
@@ -1,38 +1,0 @@
- 
- 
- 
-#include <iostream>
-
-#include "luaincl.h"
-
-
- 
- class Account : public BaseObject {
-      lua_Number m_balance;
-   public:
-     static const char className[];
-     static Lunar<Account>::RegType methods[];
-
-     Account(lua_State *L)      { m_balance = luaL_checknumber(L, 1); }
-     Account(double balance=0)    : m_balance(balance) { }
-
-     void deposit (float value) { m_balance += value; };
-     void withdraw(float value) { m_balance -= value; };
-     float balance() { return m_balance; };
-
-     int deposit (lua_State *L) { m_balance += luaL_checknumber(L, 1); return 0; }
-     int withdraw(lua_State *L) { m_balance -= luaL_checknumber(L, 1); return 0; }
-     int balance (lua_State *L) { lua_pushnumber(L, m_balance); return 1; }
-     ~Account() { printf("deleted Account (%p)\n", this); }
- };
-
- const char Account::className[] = "Account";
-
- Lunar<Account>::RegType Account::methods[] = {
-   {"deposit", new ExecutorLua1<Account, float>(&Account::deposit)},
-   {"withdraw", new ExecutorLua1<Account, float>(&Account::withdraw)},
-   {"balance", new ExecutorLua0ret<Account, float>(&Account::balance)},
-   {0,NULL}
- };
- 
-CREATE_SCRIPTABLE_CLASS(Account, CL_ACCOUNT)
Index: branches/script_engine/src/lib/script_engine/Makefile.am
===================================================================
--- branches/script_engine/src/lib/script_engine/Makefile.am	(revision 8248)
+++ branches/script_engine/src/lib/script_engine/Makefile.am	(revision 8250)
@@ -16,7 +16,7 @@
                 script_manager.cc\
 		script_class.cc\
-		account.cc\
+		account.cc \
 		object.cc
-                
+
 
 AM_CPPFLAGS= @LUA_INCLUDES@
@@ -27,5 +27,5 @@
                 script_manager.h\
 		script_class.h
-                
+
 
 
Index: branches/script_engine/src/lib/script_engine/Object.cc
===================================================================
--- branches/script_engine/src/lib/script_engine/Object.cc	(revision 8248)
+++ 	(revision )
@@ -1,52 +1,0 @@
-
-#include <iostream>
-
-#include "luaincl.h"
-
-
-
-
-class Object : public BaseObject {
-   public:
-     static const char className[];
-     static Lunar<Object>::RegType methods[];
-
-     Object(lua_State* L) {callCount = 0; }
-     Object(){callCount = 0;};
-     ~Object() { printf("deleted Object (%p)\n", this); }
-
-        //meber functions
-     void takeParam(int i)
-     {
-       printf("Lua passed %i to c++\n",i);
-     }
-
-     int printName(lua_State* L)
-     {
-       this->printName();
-       return 0;
-     }
-
-     void printName()
-     {
-       callCount ++;
-       printf("Hi i'm object %p ! This is the %i. call.\n",this,callCount);
-     }
-
-     int getCallCount(){ return callCount; }
-
-   private:
-     int callCount;
-
- };
-
- const char Object::className[] = "Object";
-
- Lunar<Object>::RegType Object::methods[] = {
-   {"printName", new ExecutorLua0<Object>(&Object::printName)},
-   {"getCallCount", new ExecutorLua0ret<Object, int>(&Object::getCallCount)},
-   {"takeParam", new ExecutorLua1<Object, int>(&Object::takeParam)},
-   {0,0}
- };
- 
-CREATE_SCRIPTABLE_CLASS(Object, CL_TEST_OBJECT)
Index: branches/script_engine/src/lib/script_engine/account.cc
===================================================================
--- branches/script_engine/src/lib/script_engine/account.cc	(revision 8250)
+++ branches/script_engine/src/lib/script_engine/account.cc	(revision 8250)
@@ -0,0 +1,42 @@
+
+
+
+#include <iostream>
+
+#include "luaincl.h"
+#include "base_object.h"
+#include "lunar.h"
+
+#include "script_class.h"
+
+
+ class Account : public BaseObject {
+      lua_Number m_balance;
+   public:
+     static const char className[];
+     static Lunar<Account>::RegType methods[];
+
+     Account(lua_State *L)      { m_balance = luaL_checknumber(L, 1); }
+     Account(double balance=0)    : m_balance(balance) { this->setClassID(CL_ACCOUNT, "Account"); }
+
+     void deposit (float value) { m_balance += value; };
+     void withdraw(float value) { m_balance -= value; };
+     float balance() { return m_balance; };
+
+     int deposit (lua_State *L) { m_balance += luaL_checknumber(L, 1); return 0; }
+     int withdraw(lua_State *L) { m_balance -= luaL_checknumber(L, 1); return 0; }
+     int balance (lua_State *L) { lua_pushnumber(L, m_balance); return 1; }
+     ~Account() { printf("deleted Account (%p)\n", this); }
+ };
+
+ const char Account::className[] = "Account";
+
+ Lunar<Account>::RegType Account::methods[] = {
+   {"deposit", new ExecutorLua1<Account, float>(&Account::deposit)},
+   {"withdraw", new ExecutorLua1<Account, float>(&Account::withdraw)},
+   {"balance", new ExecutorLua0ret<Account, float>(&Account::balance)},
+   {0,NULL}
+ };
+
+ CREATE_SCRIPTABLE_CLASS(Account, CL_ACCOUNT);
+
Index: branches/script_engine/src/lib/script_engine/object.cc
===================================================================
--- branches/script_engine/src/lib/script_engine/object.cc	(revision 8250)
+++ branches/script_engine/src/lib/script_engine/object.cc	(revision 8250)
@@ -0,0 +1,53 @@
+
+#include <iostream>
+
+#include "base_object.h"
+#include "lunar.h"
+
+#include "script_class.h"
+
+
+class Object : public BaseObject {
+   public:
+     static const char className[];
+     static Lunar<Object>::RegType methods[];
+
+     Object(lua_State* L) {callCount = 0; }
+     Object(){callCount = 0;};
+     ~Object() { printf("deleted Object (%p)\n", this); }
+
+        //meber functions
+     void takeParam(int i)
+     {
+       printf("Lua passed %i to c++\n",i);
+     }
+
+     int printName(lua_State* L)
+     {
+       this->printName();
+       return 0;
+     }
+
+     void printName()
+     {
+       callCount ++;
+       printf("Hi i'm object %p ! This is the %i. call.\n",this,callCount);
+     }
+
+     int getCallCount(){ return callCount; }
+
+   private:
+     int callCount;
+
+ };
+
+ const char Object::className[] = "Object";
+
+ Lunar<Object>::RegType Object::methods[] = {
+   {"printName", new ExecutorLua0<Object>(&Object::printName)},
+   {"getCallCount", new ExecutorLua0ret<Object, int>(&Object::getCallCount)},
+   {"takeParam", new ExecutorLua1<Object, int>(&Object::takeParam)},
+   {0,0}
+ };
+
+ CREATE_SCRIPTABLE_CLASS(Object, CL_TEST_OBJECT);
Index: branches/script_engine/src/lib/script_engine/script_class.h
===================================================================
--- branches/script_engine/src/lib/script_engine/script_class.h	(revision 8248)
+++ branches/script_engine/src/lib/script_engine/script_class.h	(revision 8250)
@@ -28,16 +28,18 @@
 {
 
-public:
-  ScriptClass(const std::string& name, ClassID classID);
-  virtual ~ScriptClass();
+  public:
+    virtual ~ScriptClass();
 
-  bool operator==(const std::string& name) { return (this->getName() == name); }
-  bool operator==(ClassID classID) { return (this->classID == classID); }
-  
-  virtual void registerClass(Script* script) = 0;
-  virtual int insertObject(Script* L, BaseObject* obj, const std::string& name, bool gc=false) = 0;
+    bool operator==(const std::string& name) { return (this->getName() == name); }
+    bool operator==(ClassID classID) { return (this->classID == classID); }
 
-private:
-  ClassID             classID;
+    virtual void registerClass(Script* script) = 0;
+    virtual int insertObject(Script* L, BaseObject* obj, bool gc=false) = 0;
+
+  protected:
+    ScriptClass(const std::string& name, ClassID classID);
+
+  private:
+    ClassID             classID;
 };
 
@@ -48,17 +50,18 @@
 class tScriptable : public ScriptClass
 {
-  tScriptable(const std::string& name, ClassID classID)
-  : ScriptClass(name, classID)
-  { }
+  public:
+    tScriptable(const std::string& name, ClassID classID)
+        : ScriptClass(name, classID)
+    { }
 
-  virtual void registerClass(Script* script)
-  {
-    Lunar<T>::Register(script);
-  }
-  virtual int insertObject(Script* L, BaseObject* obj, bool gc=false) 
-  {
-    Lunar<T>::insertObject(L, dynamic_cast<T*>(obj), obj->getName(), gc);
-  }
-  
+    virtual void registerClass(Script* script)
+    {
+      Lunar<T>::Register(script);
+    }
+    virtual int insertObject(Script* L, BaseObject* obj, bool gc=false)
+    {
+      Lunar<T>::insertObject(L, dynamic_cast<T*>(obj), obj->getName(), gc);
+    }
+
 
 
