Revision: 1782
http://yake.svn.sourceforge.net/yake/?rev=1782&view=rev
Author: psyclonist
Date: 2007-08-02 09:37:47 -0700 (Thu, 02 Aug 2007)
Log Message:
-----------
sampleEntFsm: bind 'this'
Modified Paths:
--------------
trunk/yake/samples/ent/sampleEntFsm/demo.cpp
Modified: trunk/yake/samples/ent/sampleEntFsm/demo.cpp
===================================================================
--- trunk/yake/samples/ent/sampleEntFsm/demo.cpp 2007-07-31 15:26:35 UTC (rev 1781)
+++ trunk/yake/samples/ent/sampleEntFsm/demo.cpp 2007-08-02 16:37:47 UTC (rev 1782)
@@ -181,6 +181,8 @@
machine.processEvent("go");
}
#endif
+#include "yake/bindings.lua/common/yake.lua.common.h"
+#include "yake/plugins/scriptingLua/ScriptingSystemLua.h"
int main(int argc, char* argv[])
{
try
@@ -211,7 +213,10 @@
YAKE_ASSERT( o );
ent::Entity* e = ent::Entity::cast(o); // cast to Entity*
YAKE_ASSERT( e );
+ e->properties().add("location",property::makeValueProperty<String>(""));
+ luabind::globals( static_cast<scripting::LuaVM*>(e->getFsmVM().get())->getLuaState() )["this"] = e;
+
// NB At this point the FSM has been set up by the exapp listener!
// Also the scripting VM has been initialized and is ready for use.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|