+void
+WillOWisp::goto_node(int node_no)
+{
+ walker->goto_node(node_no);
+ if(mystate != STATE_PATHMOVING && mystate != STATE_PATHMOVING_TRACK) {
+ mystate = STATE_PATHMOVING;
+ }
+}
+
+void
+WillOWisp::start_moving()
+{
+ walker->start_moving();
+}
+
+void
+WillOWisp::stop_moving()
+{
+ walker->stop_moving();
+}
+
+void
+WillOWisp::set_state(const std::string& new_state)
+{
+ if(new_state == "stopped") {
+ mystate = STATE_STOPPED;
+ } else if(new_state == "idle") {
+ mystate = STATE_IDLE;
+ } else if(new_state == "move_path") {
+ mystate = STATE_PATHMOVING;
+ walker->start_moving();
+ } else if(new_state == "move_path_track") {
+ mystate = STATE_PATHMOVING_TRACK;
+ walker->start_moving();
+ } else if(new_state == "normal") {
+ mystate = STATE_IDLE;
+ } else if(new_state == "vanish") {
+ vanish();
+ } else {
+ std::ostringstream msg;
+ msg << "Can't set unknown willowisp state '" << new_state << "', should "
+ "be stopped, move_path, move_path_track or normal";
+ throw new std::runtime_error(msg.str());
+ }
+}
+
+void
+WillOWisp::expose(HSQUIRRELVM vm, SQInteger table_idx)
+{
+ if (name.empty())
+ return;
+
+ std::cout << "Expose me '" << name << "'\n";
+ Scripting::WillOWisp* interface = static_cast<Scripting::WillOWisp*> (this);
+ expose_object(vm, table_idx, interface, name);
+}
+
+void
+WillOWisp::unexpose(HSQUIRRELVM vm, SQInteger table_idx)
+{
+ if (name.empty())
+ return;
+
+ std::cout << "UnExpose me '" << name << "'\n";
+ Scripting::unexpose_object(vm, table_idx, name);
+}
+
+IMPLEMENT_FACTORY(WillOWisp, "willowisp");