+
+ // expose ScriptedObjects to the script
+ for(Sector::GameObjects::iterator i = sector->gameobjects.begin();
+ i != sector->gameobjects.end(); ++i) {
+ GameObject* object = *i;
+ Scripting::ScriptedObject* scripted_object
+ = dynamic_cast<Scripting::ScriptedObject*> (object);
+ if(!scripted_object)
+ continue;
+
+ std::cout << "Exposing " << scripted_object->get_name() << "\n";
+ expose_object(scripted_object, scripted_object->get_name(),
+ "ScriptedObject");
+ }
+ // expose some "global" objects
+ sound = new Scripting::Sound();
+ expose_object(sound, "Sound", "Sound");
+ level = new Scripting::Level();
+ expose_object(level, "Level", "Level");
+ TextObject* text_object = new TextObject();
+ sector->add_object(text_object);
+ Scripting::Text* text = static_cast<Scripting::Text*> (text_object);
+ expose_object(text, "Text", "Text");