Browse Source

moved more ConsoleMethods to ConsoleMethodWithDocs (separating functions into a ScriptBinding file usually)

Charlie Patterson 12 years ago
parent
commit
d47295d4e4

+ 46 - 46
engine/compilers/VisualStudio 2012/Torque 2D.sln

@@ -1,46 +1,46 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Express 2012 for Windows Desktop
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Torque2D", "Torque 2D.vcxproj", "{1564A07D-230E-4C90-AEE6-52AC9A58D6C9}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ljpeg", "ljpeg.vcxproj", "{0B07BA94-AA53-4FD4-ADB4-79EC2DA53B36}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lpng", "lpng.vcxproj", "{AF1179E3-A838-46A3-A427-1E62AA4C52F4}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib.vcxproj", "{86CB2525-0CF3-40D3-BF42-A0A95035EE8C}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Release|Win32 = Release|Win32
-		Shipping|Win32 = Shipping|Win32
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{1564A07D-230E-4C90-AEE6-52AC9A58D6C9}.Debug|Win32.ActiveCfg = Debug|Win32
-		{1564A07D-230E-4C90-AEE6-52AC9A58D6C9}.Debug|Win32.Build.0 = Debug|Win32
-		{1564A07D-230E-4C90-AEE6-52AC9A58D6C9}.Release|Win32.ActiveCfg = Release|Win32
-		{1564A07D-230E-4C90-AEE6-52AC9A58D6C9}.Release|Win32.Build.0 = Release|Win32
-		{1564A07D-230E-4C90-AEE6-52AC9A58D6C9}.Shipping|Win32.ActiveCfg = Shipping|Win32
-		{1564A07D-230E-4C90-AEE6-52AC9A58D6C9}.Shipping|Win32.Build.0 = Shipping|Win32
-		{0B07BA94-AA53-4FD4-ADB4-79EC2DA53B36}.Debug|Win32.ActiveCfg = Debug|Win32
-		{0B07BA94-AA53-4FD4-ADB4-79EC2DA53B36}.Debug|Win32.Build.0 = Debug|Win32
-		{0B07BA94-AA53-4FD4-ADB4-79EC2DA53B36}.Release|Win32.ActiveCfg = Release|Win32
-		{0B07BA94-AA53-4FD4-ADB4-79EC2DA53B36}.Release|Win32.Build.0 = Release|Win32
-		{0B07BA94-AA53-4FD4-ADB4-79EC2DA53B36}.Shipping|Win32.ActiveCfg = Shipping|Win32
-		{0B07BA94-AA53-4FD4-ADB4-79EC2DA53B36}.Shipping|Win32.Build.0 = Shipping|Win32
-		{AF1179E3-A838-46A3-A427-1E62AA4C52F4}.Debug|Win32.ActiveCfg = Debug|Win32
-		{AF1179E3-A838-46A3-A427-1E62AA4C52F4}.Debug|Win32.Build.0 = Debug|Win32
-		{AF1179E3-A838-46A3-A427-1E62AA4C52F4}.Release|Win32.ActiveCfg = Release|Win32
-		{AF1179E3-A838-46A3-A427-1E62AA4C52F4}.Release|Win32.Build.0 = Release|Win32
-		{AF1179E3-A838-46A3-A427-1E62AA4C52F4}.Shipping|Win32.ActiveCfg = Shipping|Win32
-		{AF1179E3-A838-46A3-A427-1E62AA4C52F4}.Shipping|Win32.Build.0 = Shipping|Win32
-		{86CB2525-0CF3-40D3-BF42-A0A95035EE8C}.Debug|Win32.ActiveCfg = Debug|Win32
-		{86CB2525-0CF3-40D3-BF42-A0A95035EE8C}.Debug|Win32.Build.0 = Debug|Win32
-		{86CB2525-0CF3-40D3-BF42-A0A95035EE8C}.Release|Win32.ActiveCfg = Release|Win32
-		{86CB2525-0CF3-40D3-BF42-A0A95035EE8C}.Release|Win32.Build.0 = Release|Win32
-		{86CB2525-0CF3-40D3-BF42-A0A95035EE8C}.Shipping|Win32.ActiveCfg = Shipping|Win32
-		{86CB2525-0CF3-40D3-BF42-A0A95035EE8C}.Shipping|Win32.Build.0 = Shipping|Win32
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Express 2012 for Windows Desktop
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Torque2D", "Torque 2D.vcxproj", "{1564A07D-230E-4C90-AEE6-52AC9A58D6C9}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ljpeg", "ljpeg.vcxproj", "{0B07BA94-AA53-4FD4-ADB4-79EC2DA53B36}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lpng", "lpng.vcxproj", "{AF1179E3-A838-46A3-A427-1E62AA4C52F4}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib.vcxproj", "{86CB2525-0CF3-40D3-BF42-A0A95035EE8C}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Release|Win32 = Release|Win32
+		Shipping|Win32 = Shipping|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{1564A07D-230E-4C90-AEE6-52AC9A58D6C9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{1564A07D-230E-4C90-AEE6-52AC9A58D6C9}.Debug|Win32.Build.0 = Debug|Win32
+		{1564A07D-230E-4C90-AEE6-52AC9A58D6C9}.Release|Win32.ActiveCfg = Release|Win32
+		{1564A07D-230E-4C90-AEE6-52AC9A58D6C9}.Release|Win32.Build.0 = Release|Win32
+		{1564A07D-230E-4C90-AEE6-52AC9A58D6C9}.Shipping|Win32.ActiveCfg = Shipping|Win32
+		{1564A07D-230E-4C90-AEE6-52AC9A58D6C9}.Shipping|Win32.Build.0 = Shipping|Win32
+		{0B07BA94-AA53-4FD4-ADB4-79EC2DA53B36}.Debug|Win32.ActiveCfg = Debug|Win32
+		{0B07BA94-AA53-4FD4-ADB4-79EC2DA53B36}.Debug|Win32.Build.0 = Debug|Win32
+		{0B07BA94-AA53-4FD4-ADB4-79EC2DA53B36}.Release|Win32.ActiveCfg = Release|Win32
+		{0B07BA94-AA53-4FD4-ADB4-79EC2DA53B36}.Release|Win32.Build.0 = Release|Win32
+		{0B07BA94-AA53-4FD4-ADB4-79EC2DA53B36}.Shipping|Win32.ActiveCfg = Shipping|Win32
+		{0B07BA94-AA53-4FD4-ADB4-79EC2DA53B36}.Shipping|Win32.Build.0 = Shipping|Win32
+		{AF1179E3-A838-46A3-A427-1E62AA4C52F4}.Debug|Win32.ActiveCfg = Debug|Win32
+		{AF1179E3-A838-46A3-A427-1E62AA4C52F4}.Debug|Win32.Build.0 = Debug|Win32
+		{AF1179E3-A838-46A3-A427-1E62AA4C52F4}.Release|Win32.ActiveCfg = Release|Win32
+		{AF1179E3-A838-46A3-A427-1E62AA4C52F4}.Release|Win32.Build.0 = Release|Win32
+		{AF1179E3-A838-46A3-A427-1E62AA4C52F4}.Shipping|Win32.ActiveCfg = Shipping|Win32
+		{AF1179E3-A838-46A3-A427-1E62AA4C52F4}.Shipping|Win32.Build.0 = Shipping|Win32
+		{86CB2525-0CF3-40D3-BF42-A0A95035EE8C}.Debug|Win32.ActiveCfg = Debug|Win32
+		{86CB2525-0CF3-40D3-BF42-A0A95035EE8C}.Debug|Win32.Build.0 = Debug|Win32
+		{86CB2525-0CF3-40D3-BF42-A0A95035EE8C}.Release|Win32.ActiveCfg = Release|Win32
+		{86CB2525-0CF3-40D3-BF42-A0A95035EE8C}.Release|Win32.Build.0 = Release|Win32
+		{86CB2525-0CF3-40D3-BF42-A0A95035EE8C}.Shipping|Win32.ActiveCfg = Shipping|Win32
+		{86CB2525-0CF3-40D3-BF42-A0A95035EE8C}.Shipping|Win32.Build.0 = Shipping|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

+ 6 - 0
engine/compilers/VisualStudio 2012/Torque 2D.vcxproj

@@ -868,6 +868,7 @@
     <ClInclude Include="..\..\source\io\bufferStream.h" />
     <ClInclude Include="..\..\source\io\bufferStream.h" />
     <ClInclude Include="..\..\source\io\fileio.h" />
     <ClInclude Include="..\..\source\io\fileio.h" />
     <ClInclude Include="..\..\source\io\fileObject.h" />
     <ClInclude Include="..\..\source\io\fileObject.h" />
+    <ClInclude Include="..\..\source\io\fileObject_ScriptBinding.h" />
     <ClInclude Include="..\..\source\io\fileStream.h" />
     <ClInclude Include="..\..\source\io\fileStream.h" />
     <ClInclude Include="..\..\source\io\fileStreamObject.h" />
     <ClInclude Include="..\..\source\io\fileStreamObject.h" />
     <ClInclude Include="..\..\source\io\filterStream.h" />
     <ClInclude Include="..\..\source\io\filterStream.h" />
@@ -893,6 +894,7 @@
     <ClInclude Include="..\..\source\memory\safeDelete.h" />
     <ClInclude Include="..\..\source\memory\safeDelete.h" />
     <ClInclude Include="..\..\source\messaging\dispatcher.h" />
     <ClInclude Include="..\..\source\messaging\dispatcher.h" />
     <ClInclude Include="..\..\source\messaging\eventManager.h" />
     <ClInclude Include="..\..\source\messaging\eventManager.h" />
+    <ClInclude Include="..\..\source\messaging\eventManager_ScriptBinding.h" />
     <ClInclude Include="..\..\source\messaging\message.h" />
     <ClInclude Include="..\..\source\messaging\message.h" />
     <ClInclude Include="..\..\source\messaging\messageForwarder.h" />
     <ClInclude Include="..\..\source\messaging\messageForwarder.h" />
     <ClInclude Include="..\..\source\messaging\scriptMsgListener.h" />
     <ClInclude Include="..\..\source\messaging\scriptMsgListener.h" />
@@ -929,6 +931,7 @@
     <ClInclude Include="..\..\source\persistence\rapidjson\include\rapidjson\reader.h" />
     <ClInclude Include="..\..\source\persistence\rapidjson\include\rapidjson\reader.h" />
     <ClInclude Include="..\..\source\persistence\rapidjson\include\rapidjson\stringbuffer.h" />
     <ClInclude Include="..\..\source\persistence\rapidjson\include\rapidjson\stringbuffer.h" />
     <ClInclude Include="..\..\source\persistence\rapidjson\include\rapidjson\writer.h" />
     <ClInclude Include="..\..\source\persistence\rapidjson\include\rapidjson\writer.h" />
+    <ClInclude Include="..\..\source\persistence\SimXMLDocument_ScriptBinding.h" />
     <ClInclude Include="..\..\source\persistence\taml\binary\tamlBinaryReader.h" />
     <ClInclude Include="..\..\source\persistence\taml\binary\tamlBinaryReader.h" />
     <ClInclude Include="..\..\source\persistence\taml\binary\tamlBinaryWriter.h" />
     <ClInclude Include="..\..\source\persistence\taml\binary\tamlBinaryWriter.h" />
     <ClInclude Include="..\..\source\persistence\taml\json\tamlJSONParser.h" />
     <ClInclude Include="..\..\source\persistence\taml\json\tamlJSONParser.h" />
@@ -995,6 +998,7 @@
     <ClInclude Include="..\..\source\platform\GLCoreFunc.h" />
     <ClInclude Include="..\..\source\platform\GLCoreFunc.h" />
     <ClInclude Include="..\..\source\platform\GLExtFunc.h" />
     <ClInclude Include="..\..\source\platform\GLExtFunc.h" />
     <ClInclude Include="..\..\source\platform\GLUFunc.h" />
     <ClInclude Include="..\..\source\platform\GLUFunc.h" />
+    <ClInclude Include="..\..\source\platform\nativeDialogs\fileDialog_ScriptBinding.h" />
     <ClInclude Include="..\..\source\platform\platform.h" />
     <ClInclude Include="..\..\source\platform\platform.h" />
     <ClInclude Include="..\..\source\platform\platformAL.h" />
     <ClInclude Include="..\..\source\platform\platformAL.h" />
     <ClInclude Include="..\..\source\platform\platformAssert.h" />
     <ClInclude Include="..\..\source\platform\platformAssert.h" />
@@ -1068,7 +1072,9 @@
     <ClInclude Include="..\..\source\sim\SimObjectList.h" />
     <ClInclude Include="..\..\source\sim\SimObjectList.h" />
     <ClInclude Include="..\..\source\sim\simObjectPtr.h" />
     <ClInclude Include="..\..\source\sim\simObjectPtr.h" />
     <ClInclude Include="..\..\source\sim\simObjectTimerEvent.h" />
     <ClInclude Include="..\..\source\sim\simObjectTimerEvent.h" />
+    <ClInclude Include="..\..\source\sim\simObject_ScriptBinding.h" />
     <ClInclude Include="..\..\source\sim\simSet.h" />
     <ClInclude Include="..\..\source\sim\simSet.h" />
+    <ClInclude Include="..\..\source\sim\simSet_ScriptBinding.h" />
     <ClInclude Include="..\..\source\string\findMatch.h" />
     <ClInclude Include="..\..\source\string\findMatch.h" />
     <ClInclude Include="..\..\source\string\stringBuffer.h" />
     <ClInclude Include="..\..\source\string\stringBuffer.h" />
     <ClInclude Include="..\..\source\string\stringStack.h" />
     <ClInclude Include="..\..\source\string\stringStack.h" />

+ 18 - 0
engine/compilers/VisualStudio 2012/Torque 2D.vcxproj.filters

@@ -2790,6 +2790,24 @@
     <ClInclude Include="..\..\source\graphics\color_ScriptBinding.h">
     <ClInclude Include="..\..\source\graphics\color_ScriptBinding.h">
       <Filter>graphics</Filter>
       <Filter>graphics</Filter>
     </ClInclude>
     </ClInclude>
+    <ClInclude Include="..\..\source\sim\simObject_ScriptBinding.h">
+      <Filter>sim</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\sim\simSet_ScriptBinding.h">
+      <Filter>sim</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\persistence\SimXMLDocument_ScriptBinding.h">
+      <Filter>persistence</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\messaging\eventManager_ScriptBinding.h">
+      <Filter>messaging</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\io\fileObject_ScriptBinding.h">
+      <Filter>io</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\source\platform\nativeDialogs\fileDialog_ScriptBinding.h">
+      <Filter>platform\nativeDialogs</Filter>
+    </ClInclude>
   </ItemGroup>
   </ItemGroup>
   <ItemGroup>
   <ItemGroup>
     <CustomBuild Include="..\..\source\math\mMath_ASM.asm">
     <CustomBuild Include="..\..\source\math\mMath_ASM.asm">

BIN
engine/source/assets/assetQuery_ScriptBinding.h


+ 2 - 77
engine/source/io/fileObject.cc

@@ -22,6 +22,8 @@
 
 
 #include "fileObject.h"
 #include "fileObject.h"
 
 
+#include "fileObject_ScriptBinding.h"
+
 IMPLEMENT_CONOBJECT(FileObject);
 IMPLEMENT_CONOBJECT(FileObject);
 
 
 bool FileObject::isEOF()
 bool FileObject::isEOF()
@@ -167,80 +169,3 @@ void FileObject::writeObject( SimObject* object, const U8* objectPrepend )
       stream.write(dStrlen((const char *) objectPrepend), objectPrepend );
       stream.write(dStrlen((const char *) objectPrepend), objectPrepend );
    object->write( stream, 0 );
    object->write( stream, 0 );
 }
 }
-
-ConsoleMethod( FileObject, openForRead, bool, 3, 3, "( filename ) Use the openForRead method to open a previously created file for reading.\n"
-                                                                "@param filename The path and filename of the file to open for reading.\n"
-                                                                "@return Returns true if the file was successfully opened for reading, false otherwise.\n"
-                                                                "@sa close, OpenForAppend, OpenForWrite")
-{
-   return object->readMemory(argv[2]);
-}
-
-ConsoleMethod( FileObject, openForWrite, bool, 3, 3, "( filename ) Use the openForWrite method to previously created or a new file for writing. In either case, the file will be overwritten.\n"
-                                                                "@param filename The path and filename of the file to open for writing.\n"
-                                                                "@return Returns true if the file was successfully opened for writing, false otherwise.\n"
-                                                                "@sa close, OpenForAppend, openForRead")
-{
-   return object->openForWrite(argv[2]);
-}
-
-ConsoleMethod( FileObject, openForAppend, bool, 3, 3, "( filename ) Use the openForAppend method to open a previously created file for appending. If the file specified by filename does not exist, the file is created first.\n"
-                                                                "@param filename The path and filename of the file to open for appending.\n"
-                                                                "@return Returns true if the file was successfully opened for appending, false otherwise.\n"
-                                                                "@sa close, openForRead, openForWrite")
-{
-   return object->openForWrite(argv[2], true);
-}
-
-ConsoleMethod( FileObject, isEOF, bool, 2, 2, "() Use the isEOF method to check to see if the end of the current file (opened for read) has been reached.\n"
-                                                                "@return Returns true if the end of file has been reached, false otherwise.\n"
-                                                                "@sa openForRead")
-{
-   return object->isEOF();
-}
-
-ConsoleMethod( FileObject, readLine, const char*, 2, 2, "() Use the readLine method to read a single line from a file previously opened for reading.\n"
-                                                                "Use isEOF to check for end of file while reading.\n"
-                                                                "@return Returns the next line in the file, or a NULL string if the end-of-file has been reached.\n"
-                                                                "@sa isEOF, openForRead")
-{
-   return (const char *) object->readLine();
-}
-
-ConsoleMethod( FileObject, peekLine, const char*, 2, 2, "Read a line from the file without moving the stream position.")
-{
-   char *line = Con::getReturnBuffer( 512 );
-   object->peekLine( (U8*)line, 512 );
-   return line;
-}
-
-ConsoleMethod( FileObject, writeLine, void, 3, 3, "( text ) Use the writeLine method to write a value ( text ) into a file that was previously opened for appending or over-writing.\n"
-                                                                "@param text The value to write to the file.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa openForAppend, openForWrite")
-{
-   object->writeLine((const U8 *) argv[2]);
-}
-
-ConsoleMethod( FileObject, close, void, 2, 2, "() Use the close method to close the current file handle. If the file was opened for writing, this flushes the contents of the last write to disk.\n"
-                                                                "@return No return value.\n"
-                                                                "@sa openForAppend, openForRead, openForWrite")
-{
-   object->close();
-}
-
-ConsoleMethod( FileObject, writeObject, void, 3, 4, "FileObject.writeObject(SimObject, object prepend)" )
-{
-   SimObject* obj = Sim::findObject( argv[2] );
-   if( !obj )
-   {
-      Con::printf("FileObject::writeObject - Invalid Object!");
-      return;
-   }
-
-   char *objName = NULL;
-   if( argc == 4 )
-      objName = (char*)argv[3];
-
-   object->writeObject( obj, (const U8*)objName );
-}

BIN
engine/source/io/fileObject_ScriptBinding.h


+ 2 - 80
engine/source/messaging/eventManager.cc

@@ -24,6 +24,8 @@
 #include "console/consoleTypes.h"
 #include "console/consoleTypes.h"
 #include "console/consoleInternal.h"
 #include "console/consoleInternal.h"
 
 
+#include "eventManager_ScriptBinding.h"
+
 IMPLEMENT_CONOBJECT( EventManager );
 IMPLEMENT_CONOBJECT( EventManager );
 
 
 Vector<EventManager*> EventManager::smEventManagers;
 Vector<EventManager*> EventManager::smEventManagers;
@@ -340,83 +342,3 @@ void EventManager::dumpSubscribers()
    for( Vector<StringTableEntry>::const_iterator iter = mEvents.begin(); iter != mEvents.end(); iter++ )
    for( Vector<StringTableEntry>::const_iterator iter = mEvents.begin(); iter != mEvents.end(); iter++ )
       dumpSubscribers( *iter );
       dumpSubscribers( *iter );
 }
 }
-
-//-----------------------------------------------------------------------------
-// Console Methods
-//-----------------------------------------------------------------------------
-ConsoleMethod( EventManager, registerEvent, bool, 3, 3, "( String event )\n"
-              "Register an event with the event manager.\n"
-              "@param event The event to register.\n"
-              "@return Whether or not the event was registered successfully." )
-{
-   return object->registerEvent( argv[2] );
-}
-
-ConsoleMethod( EventManager, unregisterEvent, void, 3, 3, "( String event )\n"
-              "Remove an event from the EventManager.\n"
-              "@param event The event to remove.\n" )
-{
-   object->unregisterEvent( argv[2] );
-}
-
-ConsoleMethod( EventManager, isRegisteredEvent, bool, 3, 3, "( String event )\n"
-              "Check if an event is registered or not.\n"
-              "@param event The event to check.\n"
-              "@return Whether or not the event exists." )
-{
-   return object->isRegisteredEvent( argv[2] );
-}
-
-ConsoleMethod( EventManager, postEvent, bool, 3, 4, "( String event, String data )\n"
-              "Trigger an event.\n"
-              "@param event The event to trigger.\n"
-              "@param data The data associated with the event.\n"
-              "@return Whether or not the event was dispatched successfully." )
-{
-   return object->postEvent( argv[2], argc > 3 ? argv[3] : "" );
-}
-
-ConsoleMethod( EventManager, subscribe, bool, 4, 5, "( SimObject listener, String event, String callback )\n\n"
-              "Subscribe a listener to an event.\n"
-              "@param listener The listener to subscribe.\n"
-              "@param event The event to subscribe to.\n"
-              "@param callback Optional method name to receive the event notification. If this is not specified, \"on[event]\" will be used.\n"
-              "@return Whether or not the subscription was successful." )
-{
-   // Find the listener object.
-   SimObject *cbObj = dynamic_cast<SimObject *>(Sim::findObject(argv[2]));
-   if( cbObj == NULL )
-   {
-      Con::warnf( "EventManager::subscribe - Invalid listener." );
-      return false;
-   }
-
-   return object->subscribe( cbObj, argv[3], argc > 4 ? argv[4] : NULL );
-}
-
-ConsoleMethod( EventManager, remove, void, 4, 4, "( SimObject listener, String event )\n\n"
-              "Remove a listener from an event.\n"
-              "@param listener The listener to remove.\n"
-              "@param event The event to be removed from.\n")
-{
-   // Find the listener object.
-   SimObject * listener = dynamic_cast< SimObject * >( Sim::findObject( argv[2] ) );
-   if( listener )
-      object->remove( listener, argv[3] );
-}
-
-ConsoleMethod( EventManager, dumpEvents, void, 2, 2, "()\n\n"
-              "Print all registered events to the console." )
-{
-   object->dumpEvents();
-}
-
-ConsoleMethod( EventManager, dumpSubscribers, void, 2, 3, "( String event )\n\n"
-              "Print all subscribers to an event to the console.\n"
-              "@param event The event whose subscribers are to be printed. If this parameter isn't specified, all events will be dumped." )
-{
-   if( argc > 2 )
-      object->dumpSubscribers( argv[2] );
-   else
-      object->dumpSubscribers();
-}

BIN
engine/source/messaging/eventManager_ScriptBinding.h


+ 5 - 254
engine/source/persistence/SimXMLDocument.cpp

@@ -20,10 +20,6 @@
 // IN THE SOFTWARE.
 // IN THE SOFTWARE.
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-////////////////////////////////////////////////////////////////////////////////
-// XML Document Object
-////////////////////////////////////////////////////////////////////////////////
-
 #include "persistence/SimXMLDocument.h"
 #include "persistence/SimXMLDocument.h"
 #include "memory/frameAllocator.h"
 #include "memory/frameAllocator.h"
 #include "sim/simBase.h"
 #include "sim/simBase.h"
@@ -31,6 +27,8 @@
 #include "io/resource/resourceManager.h"
 #include "io/resource/resourceManager.h"
 #include "io/fileStream.h"
 #include "io/fileStream.h"
 
 
+#include "SimXMLDocument_ScriptBinding.h"
+
 IMPLEMENT_CONOBJECT(SimXMLDocument);
 IMPLEMENT_CONOBJECT(SimXMLDocument);
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
@@ -112,12 +110,6 @@ void SimXMLDocument::reset(void)
    m_paNode.clear();
    m_paNode.clear();
    m_CurrentAttribute = 0;
    m_CurrentAttribute = 0;
 }
 }
-ConsoleMethod(SimXMLDocument, reset, void, 2, 2,
-              "() Set this to default state at construction.\n"
-              "@return No return value")
-{
-   object->reset();
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Get true if file loads successfully.
 // Get true if file loads successfully.
@@ -128,12 +120,6 @@ S32 SimXMLDocument::loadFile(const char* rFileName)
 
 
    return m_qDocument->LoadFile(rFileName);
    return m_qDocument->LoadFile(rFileName);
 }
 }
-ConsoleMethod(SimXMLDocument, loadFile, S32, 3, 3, "(string fileName) Load file from given filename.\n"
-              "@param fileName The name of the desired file\n"
-              "@return Returns 1 on success and 0 otherwise")
-{
-   return object->loadFile( argv[2] );
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Get true if file saves successfully.
 // Get true if file saves successfully.
@@ -160,12 +146,6 @@ S32 SimXMLDocument::saveFile(const char* rFileName)
 
 
    return retVal;
    return retVal;
 }
 }
-ConsoleMethod(SimXMLDocument, saveFile, S32, 3, 3, "(string fileName) Save file to given filename.\n"
-              "@param fileName A string presenting the filename to save the XML document as\n"
-              "@return Returns 1 on success, and 0 otherwise")
-{
-   return object->saveFile( argv[2] );
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Get true if XML text parses correctly.
 // Get true if XML text parses correctly.
@@ -176,12 +156,6 @@ S32 SimXMLDocument::parse(const char* rText)
    m_qDocument->Parse( rText );
    m_qDocument->Parse( rText );
    return 1;
    return 1;
 }
 }
-ConsoleMethod(SimXMLDocument, parse, S32, 3, 3, "(string txtXML) Create document from XML string.\n"
-              "@param txtXML The text of the XML document\n"
-              "@return Returns 1 on success")
-{
-   return object->parse( argv[2] );
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Clear contents of XML document.
 // Clear contents of XML document.
@@ -190,11 +164,6 @@ void SimXMLDocument::clear(void)
 {
 {
    reset();
    reset();
 }
 }
-ConsoleMethod(SimXMLDocument, clear, void, 2, 2, "() Clear contents of XML document.\n"
-              "@return No return value")
-{
-   object->clear();
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Get error description of XML document.
 // Get error description of XML document.
@@ -207,17 +176,6 @@ const char* SimXMLDocument::getErrorDesc(void) const
    }
    }
    return m_qDocument->ErrorDesc();
    return m_qDocument->ErrorDesc();
 }
 }
-ConsoleMethod(SimXMLDocument, getErrorDesc, const char*, 2, 2,
-              "() Get current error description.\n"
-              "@return Returns a string with the error description")
-{
-   // Create Returnable Buffer (duration of error description is unknown).
-   char* pBuffer = Con::getReturnBuffer(256);
-   // Format Buffer.
-   dSprintf(pBuffer, 256, "%s", object->getErrorDesc());
-   // Return Velocity.
-   return pBuffer;
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Clear error description of this.
 // Clear error description of this.
@@ -226,12 +184,6 @@ void SimXMLDocument::clearError(void)
 {
 {
    m_qDocument->ClearError();
    m_qDocument->ClearError();
 }
 }
-ConsoleMethod(SimXMLDocument, clearError, void, 2, 2,
-              "() Clear error description.\n"
-              "@return No return value")
-{
-   object->clearError();
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Get true if first child element was successfully pushed onto stack.
 // Get true if first child element was successfully pushed onto stack.
@@ -269,13 +221,6 @@ bool SimXMLDocument::pushFirstChildElement(const char* rName)
    m_paNode.push_back(pElement);
    m_paNode.push_back(pElement);
    return true;
    return true;
 }
 }
-ConsoleMethod(SimXMLDocument, pushFirstChildElement, bool, 3, 3,
-              "(string name) Push first child element with given name onto stack.\n"
-              "@param name The name of the child element"
-              "@return returns true on success, false otherwise.")
-{
-   return object->pushFirstChildElement( argv[2] );
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Get true if first child element was successfully pushed onto stack.
 // Get true if first child element was successfully pushed onto stack.
@@ -327,13 +272,6 @@ bool SimXMLDocument::pushChildElement(S32 index)
    m_paNode.push_back(pElement);
    m_paNode.push_back(pElement);
    return true;
    return true;
 }
 }
-ConsoleMethod(SimXMLDocument, pushChildElement, bool, 3, 3,
-              "(int index) Push the child element at the given index onto stack.\n"
-              "@param index A nonnegative integer representing the index of the child element\n"
-              "@return Returns true on success, and false otherwise")
-{
-   return object->pushChildElement( dAtoi( argv[2] ) );
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Convert top stack element into its next sibling element.
 // Convert top stack element into its next sibling element.
@@ -363,13 +301,6 @@ bool SimXMLDocument::nextSiblingElement(const char* rName)
 
 
    return true;
    return true;
 }
 }
-ConsoleMethod(SimXMLDocument, nextSiblingElement, bool, 3, 3,
-              "(string name) Set top element on stack to next element with given name.\n"
-              "@param name The name of the element.\n"
-              "@return Returns true on success, false otherwise")
-{
-   return object->nextSiblingElement( argv[2] );
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Get element value if it exists.  Used to extract a text node from the element.
 // Get element value if it exists.  Used to extract a text node from the element.
@@ -390,15 +321,6 @@ const char* SimXMLDocument::elementValue()
 
 
    return pNode->Value();
    return pNode->Value();
 }
 }
-ConsoleMethod(SimXMLDocument, elementValue, const char*, 2, 2,
-              "() Get element value if it exists.\n"
-              "@return A string with the desired value, or empty if not found.")
-{
-   // Create Returnable Buffer (because duration of value is unknown).
-   char* pBuffer = Con::getReturnBuffer(256);
-   dSprintf(pBuffer, 256, "%s", object->elementValue());
-   return pBuffer;
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Pop last element off of stack.
 // Pop last element off of stack.
@@ -407,12 +329,7 @@ void SimXMLDocument::popElement(void)
 {
 {
    m_paNode.pop_back();
    m_paNode.pop_back();
 }
 }
-ConsoleMethod(SimXMLDocument, popElement, void, 2, 2,
-              "() Pop last element off of stack.\n"
-              "@return No return value")
-{
-   object->popElement();
-}
+
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Get attribute value if it exists.
 // Get attribute value if it exists.
@@ -437,32 +354,6 @@ const char* SimXMLDocument::attribute(const char* rAttribute)
 
 
    return pNode->Attribute(rAttribute);
    return pNode->Attribute(rAttribute);
 }
 }
-ConsoleMethod(SimXMLDocument, attribute, const char*, 3, 3,
-              "(string attribute) Get attribute value if it exists.\n"
-              "@param attribute The desired SimXMLDocument attribute\n"
-              "@return Returns the value of the attribute as a string, or an empty string on failure")
-{
-   // Create Returnable Buffer (because duration of attribute is unknown).
-   char* pBuffer = Con::getReturnBuffer(256);
-   // Format Buffer.
-   dSprintf(pBuffer, 256, "%s", object->attribute( argv[2] ));
-   // Return Velocity.
-   return pBuffer;
-}
-ConsoleMethod(SimXMLDocument, attributeF32, F32, 3, 3,
-              "(string attribute) Get attribute value if it exists.\n"
-              "@param attribute The desired SimXMLDocument attribute\n"
-              "@return Returns the value of the attribute converted to 32-bit floating-point value from string")
-{
-   return dAtof( object->attribute( argv[2] ) );
-}
-ConsoleMethod(SimXMLDocument, attributeS32, S32, 3, 3,
-              "(string attribute) Get attribute value if it exists.\n"
-              "@param attribute The desired SimXMLDocument attribute\n"
-              "@return Returns the value of the attribute converted to 32-bit integer value from string")
-{
-   return dAtoi( object->attribute( argv[2] ) );
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Get true if given attribute exists.
 // Get true if given attribute exists.
@@ -487,13 +378,7 @@ bool SimXMLDocument::attributeExists(const char* rAttribute)
 
 
    return true;
    return true;
 }
 }
-ConsoleMethod(SimXMLDocument, attributeExists, bool, 3, 3,
-              "(string attribute) Get true if named attribute exists.\n"
-              "@param attribute The desired attribute's name\n"
-              "@return Returns true if attribute exists and false otherwise")
-{
-   return object->attributeExists( argv[2] );
-}
+
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Obtain the name of the current element's first attribute
 // Obtain the name of the current element's first attribute
@@ -521,17 +406,6 @@ const char* SimXMLDocument::firstAttribute()
 
 
    return m_CurrentAttribute->Name();
    return m_CurrentAttribute->Name();
 }
 }
-ConsoleMethod(SimXMLDocument, firstAttribute, const char*, 2, 2,
-              "() Obtain the name of the current element's first attribute.\n"
-              "@return A string with the name of the first attribute")
-{
-   const char* name = object->firstAttribute();
-
-   // Create Returnable Buffer (because duration of attribute is unknown).
-   char* pBuffer = Con::getReturnBuffer(dStrlen(name)+1);
-   dStrcpy(pBuffer, name);
-   return pBuffer;
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Obtain the name of the current element's last attribute
 // Obtain the name of the current element's last attribute
@@ -559,17 +433,6 @@ const char* SimXMLDocument::lastAttribute()
 
 
    return m_CurrentAttribute->Name();
    return m_CurrentAttribute->Name();
 }
 }
-ConsoleMethod(SimXMLDocument, lastAttribute, const char*, 2, 2,
-              "() Obtain the name of the current element's last attribute.\n"
-              "@return A string with the name of the last attribute")
-{
-   const char* name = object->lastAttribute();
-
-   // Create Returnable Buffer (because duration of attribute is unknown).
-   char* pBuffer = Con::getReturnBuffer(dStrlen(name)+1);
-   dStrcpy(pBuffer, name);
-   return pBuffer;
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Get the name of the next attribute for the current element after a call
 // Get the name of the next attribute for the current element after a call
@@ -591,17 +454,7 @@ const char* SimXMLDocument::nextAttribute()
 
 
    return m_CurrentAttribute->Name();
    return m_CurrentAttribute->Name();
 }
 }
-ConsoleMethod(SimXMLDocument, nextAttribute, const char*, 2, 2,
-              "() Get the name of the next attribute for the current element after a call to firstAttribute().\n"
-              "@return A string with the name of the next attribute")
-{
-   const char* name = object->nextAttribute();
 
 
-   // Create Returnable Buffer (because duration of attribute is unknown).
-   char* pBuffer = Con::getReturnBuffer(dStrlen(name)+1);
-   dStrcpy(pBuffer, name);
-   return pBuffer;
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Get the name of the previous attribute for the current element after a call
 // Get the name of the previous attribute for the current element after a call
@@ -623,17 +476,7 @@ const char* SimXMLDocument::prevAttribute()
 
 
    return m_CurrentAttribute->Name();
    return m_CurrentAttribute->Name();
 }
 }
-ConsoleMethod(SimXMLDocument, prevAttribute, const char*, 2, 2,
-              "() Get the name of the previous attribute for the current element after a call to lastAttribute().\n"
-              "@return A string with the name of the previous attribute")
-{
-   const char* name = object->prevAttribute();
 
 
-   // Create Returnable Buffer (because duration of attribute is unknown).
-   char* pBuffer = Con::getReturnBuffer(dStrlen(name)+1);
-   dStrcpy(pBuffer, name);
-   return pBuffer;
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Set attribute of top stack element to given value.
 // Set attribute of top stack element to given value.
@@ -653,14 +496,7 @@ void SimXMLDocument::setAttribute(const char* rAttribute, const char* rVal)
    }
    }
    pElement->SetAttribute(rAttribute, rVal);
    pElement->SetAttribute(rAttribute, rVal);
 }
 }
-ConsoleMethod(SimXMLDocument, setAttribute, void, 4, 4,
-              "(string attributeName, string attributeValue) Set attribute of top stack element to given value.\n"
-              "@param attributeName The name of the attribute of the element you wish to set\n"
-              "@param attributeValue The value you wish to set the given attribute to\n"
-              "@return No return value.")
-{
-   object->setAttribute(argv[2], argv[3]);
-}
+
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Set attribute of top stack element to given value.
 // Set attribute of top stack element to given value.
@@ -782,13 +618,6 @@ void SimXMLDocument::setObjectAttributes(const char* objectID)
       //}
       //}
 
 
 }
 }
-ConsoleMethod(SimXMLDocument, setObjectAttributes, void, 3, 3,
-              "(string attributeValue) Set attribute of top stack element to given value.\n"
-              "@param attributeValue The value you wish to set the given attribute to\n"
-              "@return No return value.")
-{
-   object->setObjectAttributes(argv[2]);
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Create a new element and set to child of current stack element.
 // Create a new element and set to child of current stack element.
@@ -820,14 +649,6 @@ void SimXMLDocument::pushNewElement(const char* rName)
    }
    }
    m_paNode.push_back(pStackTop);
    m_paNode.push_back(pStackTop);
 }
 }
-ConsoleMethod(SimXMLDocument, pushNewElement, void, 3, 3,
-              "(string name) Create new element as child of current stack element "
-              "and push new element on to stack.\n"
-              "@param name The anme of the new element\n"
-              "@return No return value")
-{
-   object->pushNewElement( argv[2] );
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Create a new element and set to child of current stack element.
 // Create a new element and set to child of current stack element.
@@ -881,14 +702,6 @@ void SimXMLDocument::addNewElement(const char* rName)
       //pNode = pStackTop;
       //pNode = pStackTop;
    }
    }
 }
 }
-ConsoleMethod(SimXMLDocument, addNewElement, void, 3, 3,
-              "(string name) Create new element as child of current stack element "
-              "and push new element on to stack.\n"
-              "@param name The anme of the new element\n"
-              "@return No return value")
-{
-   object->addNewElement( argv[2] );
-}
 
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // Write XML document declaration.
 // Write XML document declaration.
@@ -898,11 +711,6 @@ void SimXMLDocument::addHeader(void)
    TiXmlDeclaration cDeclaration("1.0", "utf-8", "yes");
    TiXmlDeclaration cDeclaration("1.0", "utf-8", "yes");
    m_qDocument->InsertEndChild(cDeclaration);
    m_qDocument->InsertEndChild(cDeclaration);
 }
 }
-ConsoleMethod(SimXMLDocument, addHeader, void, 2, 2, "() Add XML header to document.\n"
-              "@return No return value.")
-{
-   object->addHeader();
-}
 
 
 void SimXMLDocument::addComment(const char* comment)
 void SimXMLDocument::addComment(const char* comment)
 {
 {
@@ -923,12 +731,6 @@ void SimXMLDocument::addComment(const char* comment)
     }
     }
     pNode->InsertEndChild( cComment );
     pNode->InsertEndChild( cComment );
 }
 }
-ConsoleMethod(SimXMLDocument, addComment, void, 3, 3, "(string comment) Add the given comment as a child of current stack element.\n"
-              "@param comment The desired comment to add\n"
-              "@return No return value.")
-{
-   object->addComment(argv[2]);
-}
 
 
 const char* SimXMLDocument::readComment( S32 index )
 const char* SimXMLDocument::readComment( S32 index )
 {
 {
@@ -984,12 +786,6 @@ const char* SimXMLDocument::readComment( S32 index )
    }
    }
    return "";
    return "";
 }
 }
-ConsoleMethod(SimXMLDocument, readComment, const char*, 3, 3, "(S32 index) Returns the comment at the specified index.\n"
-              "@param index The index of the desired comment as a nonnegative integer value\n"
-              "@return The comment as a string")
-{
-   return object->readComment( dAtoi( argv[2] ) );
-}
 
 
 void SimXMLDocument::addText(const char* text)
 void SimXMLDocument::addText(const char* text)
 {
 {
@@ -1005,13 +801,6 @@ void SimXMLDocument::addText(const char* text)
    pNode->InsertEndChild( cText );
    pNode->InsertEndChild( cText );
 }
 }
 
 
-ConsoleMethod(SimXMLDocument, addText, void, 3, 3, "(string text) Add the given text as a child of current stack element.\n"
-              "@param text The desired text to add\n"
-              "@return No return value.")
-{
-   object->addText(argv[2]);
-}
-
 const char* SimXMLDocument::getText()
 const char* SimXMLDocument::getText()
 {
 {
    if(m_paNode.empty())
    if(m_paNode.empty())
@@ -1029,18 +818,6 @@ const char* SimXMLDocument::getText()
    return text->Value();
    return text->Value();
 }
 }
 
 
-ConsoleMethod(SimXMLDocument, getText, const char*, 2, 2, "() Gets the text from the current stack element.\n"
-              "@return Returns the desired text, or empty string on failure")
-{
-   const char* text = object->getText();
-   if( !text )
-      return "";
-
-   char* pBuffer = Con::getReturnBuffer(dStrlen( text ) + 1);
-   dStrcpy( pBuffer, text );
-   return pBuffer;
-}
-
 void SimXMLDocument::removeText()
 void SimXMLDocument::removeText()
 {
 {
    if(m_paNode.empty())
    if(m_paNode.empty())
@@ -1058,12 +835,6 @@ void SimXMLDocument::removeText()
    pNode->RemoveChild(text);
    pNode->RemoveChild(text);
 }
 }
 
 
-ConsoleMethod(SimXMLDocument, removeText, void, 2, 2, "() Remove any text on the current stack element.\n"
-              "@return No return value\n")
-{
-   object->removeText();
-}
-
 void SimXMLDocument::addData(const char* text)
 void SimXMLDocument::addData(const char* text)
 {
 {
    if(m_paNode.empty())
    if(m_paNode.empty())
@@ -1078,12 +849,6 @@ void SimXMLDocument::addData(const char* text)
    pNode->InsertEndChild( cText );
    pNode->InsertEndChild( cText );
 }
 }
 
 
-ConsoleMethod(SimXMLDocument, addData, void, 3, 3, "(string text) Add the given text as a child of current stack element.\n"
-              "@param The desired text to add\n"
-              "@return No return value")
-{
-   object->addData(argv[2]);
-}
 
 
 const char* SimXMLDocument::getData()
 const char* SimXMLDocument::getData()
 {
 {
@@ -1101,17 +866,3 @@ const char* SimXMLDocument::getData()
 
 
    return text->Value();
    return text->Value();
 }
 }
-
-ConsoleMethod(SimXMLDocument, getData, const char*, 2, 2, "() Gets the text from the current stack element.\n"
-              "@return Returns the desired text or empty string if failed (no text)")
-{
-   const char* text = object->getData();
-   if( !text )
-      return "";
-
-   char* pBuffer = Con::getReturnBuffer(dStrlen( text ) + 1);
-   dStrcpy( pBuffer, text );
-   return pBuffer;
-}
-
-////EOF/////////////////////////////////////////////////////////////////////////

BIN
engine/source/persistence/SimXMLDocument_ScriptBinding.h


+ 2 - 478
engine/source/sim/simObject.cc

@@ -30,6 +30,8 @@
 #include "io/fileObject.h"
 #include "io/fileObject.h"
 #include "console/consoleTypeValidators.h"
 #include "console/consoleTypeValidators.h"
 
 
+#include "simObject_ScriptBinding.h"
+
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
 IMPLEMENT_CONOBJECT(SimObject);
 IMPLEMENT_CONOBJECT(SimObject);
@@ -459,22 +461,11 @@ void SimObject::setInternalName(const char* newname)
       mInternalName = StringTable->insert(newname);
       mInternalName = StringTable->insert(newname);
 }
 }
 
 
-ConsoleMethod( SimObject, getInternalName, const char*, 2, 2, "getInternalName returns the objects internal name")
-{
-   return object->getInternalName();
-}
-
 StringTableEntry SimObject::getInternalName()
 StringTableEntry SimObject::getInternalName()
 {
 {
    return mInternalName;
    return mInternalName;
 }
 }
 
 
-
-ConsoleMethod(SimObject, dumpClassHierarchy, void, 2, 2, "obj.dumpClassHierarchy()")
-{
-   object->dumpClassHierarchy();
-}
-
 void  SimObject::dumpClassHierarchy()
 void  SimObject::dumpClassHierarchy()
 {
 {
    AbstractClassRep* pRep = getClassRep();
    AbstractClassRep* pRep = getClassRep();
@@ -485,327 +476,6 @@ void  SimObject::dumpClassHierarchy()
    }
    }
 }
 }
 
 
-ConsoleMethod(SimObject, isMemberOfClass, bool, 3, 3, " isMemberOfClass(string classname) -- returns true if this object is a member of the specified class")
-{
-
-   AbstractClassRep* pRep = object->getClassRep();
-   while(pRep)
-   {
-      if(!dStricmp(pRep->getClassName(), argv[2]))
-      {
-         //matches
-         return true;
-      }
-
-      pRep	=	pRep->getParentClass();
-   }
-
-   return false;
-}
-
-ConsoleMethod(SimObject, save, bool, 3, 4, "obj.save(fileName, [selectedOnly])")
-{
-   bool bSelectedOnly	=	false;
-   if(argc > 3)
-      bSelectedOnly	= dAtob(argv[3]);
-
-   const char* filename = NULL;
-
-   filename = argv[2];
-
-   if(filename == NULL || *filename == 0)
-      return false;
-
-   return object->save(filename, bSelectedOnly);
-
-}
-
-ConsoleMethod(SimObject, setName, void, 3, 3, "obj.setName(newName)")
-{
-   object->assignName(argv[2]);
-}
-
-ConsoleMethod(SimObject, getName, const char *, 2, 2, "obj.getName()")
-{
-   const char *ret = object->getName();
-   return ret ? ret : "";
-}
-
-ConsoleMethod(SimObject, getClassName, const char *, 2, 2, "obj.getClassName()")
-{
-   const char *ret = object->getClassName();
-   return ret ? ret : "";
-}
-
-ConsoleMethod(SimObject, getFieldValue, const char *, 3, 3, "obj.getFieldValue(fieldName);")
-{
-   const char *fieldName = StringTable->insert( argv[2] );
-   return object->getDataField( fieldName, NULL );
-}
-
-
-ConsoleMethod(SimObject, setFieldValue, bool, 4, 4, "obj.setFieldValue(fieldName,value);")
-{
-   const char *fieldName = StringTable->insert(argv[2]);
-   const char *value = argv[3];
-
-   object->setDataField( fieldName, NULL, value );
-
-   return true;
-
-}
-
-ConsoleMethod(SimObject, getFieldType, const char *, 3, 3, "obj.getFieldType(fieldName);")
-{
-   const char *fieldName = StringTable->insert( argv[2] );
-   U32 typeID = object->getDataFieldType( fieldName, NULL );
-   ConsoleBaseType* type = ConsoleBaseType::getType( typeID );
-   
-   if( type )
-      return type->getTypeClassName();
-
-   return "";
-}
-
-ConsoleMethod( SimObject, call, const char*, 2, 0, "( %args ) - Dynamically call a method on an object." )
-{
-   argv[1] = argv[2];
-   return Con::execute( object, argc - 1, argv + 1 );
-}
-
-//-----------------------------------------------------------------------------
-//	Set the internal name, can be used to find child objects
-//	in a meaningful way, usually from script, while keeping
-//	common script functionality together using the controls "Name" field.
-//-----------------------------------------------------------------------------
-ConsoleMethod( SimObject, setInternalName, void, 3, 3, "string InternalName")
-{
-   object->setInternalName(argv[2]);
-}
-
-ConsoleMethod(SimObject, getId, S32, 2, 2, "() Use the getId method to get the numeric ID of this shape.\n"
-                                                                "@return Returns the unique numeric ID of this shape.\n"
-                                                                "@sa getName, setName")
-{
-   return object->getId();
-}
-
-ConsoleMethod(SimObject, getGroup, S32, 2, 2, "() Use the getGroup method to determine if this object is contained in a SimGroup and if so, which one.\n"
-                                                                "@return Returns the ID of the SimGroup this shape is in or zero if the shape is not contained in a SimGroup")
-{
-   SimGroup *grp = object->getGroup();
-   if(!grp)
-      return -1;
-   return grp->getId();
-}
-
-ConsoleMethod(SimObject, delete, void, 2, 2,"() Use the delete method to delete this object.\n"
-                                                                "When an object is deleted, it automatically: Unregisters its ID and name (if it has one) with the engine. Removes itself from any SimGroup or SimSet it may be a member of. (eventually) returns the memory associated with itself and its non-dynamic members. Cancels all pending %obj.schedule() events. For objects in the GameBase, ScriptObject, or GUIControl hierarchies, an object will first: Call the onRemove() method for the object's namespace\n"
-                                                                "@return No return value.")
-{
-   object->deleteObject();
-}
-
-ConsoleMethod(SimObject,schedule, S32, 4, 0, "(time , command , <arg1 ... argN> ) Use the schedule method to schedule an action to be executed upon this object time milliseconds in the future.\n"
-                                                                "The major difference between this and the schedule console function is that if this object is deleted prior to the scheduled event, the event is automatically canceled. times should not be treated as exact since some 'simulation delay' is to be expected. The minimum resolution for a scheduled event is \"32 ms, or one tick. schedule does not validate the existence of command. i.e. If you pass an invalid console method name, the schedule() method will still return a schedule ID, but the subsequent event will fail silently.\n"
-                                                                "@param time Time in milliseconds till action is scheduled to occur.\n"
-                                                                "@param command Name of the command to execute. This command must be scoped to this object (i.e. It must exist in the namespace of the object), otherwise the schedule call will fail.\n"
-                                                                "@param arg1...argN These are optional arguments which will be passed to command. This version of schedule automatically passes the ID of %obj as arg0 to command.\n"
-                                                                "@return Returns an integer schedule ID.\n"
-                                                                "@sa See the schedule console function and its corresponding helper functions.")
-{
-   U32 timeDelta = U32(dAtof(argv[2]));
-   argv[2] = argv[3];
-   argv[3] = argv[1];
-   SimConsoleEvent *evt = new SimConsoleEvent(argc - 2, argv + 2, true);
-   S32 ret = Sim::postEvent(object, evt, Sim::getCurrentTime() + timeDelta);
-// #ifdef DEBUG
-//    Con::printf("obj %s schedule(%s) = %d", argv[3], argv[2], ret);
-//    Con::executef(1, "backtrace");
-// #endif
-   return ret;
-}
-
-static S32 QSORT_CALLBACK compareFields(const void* a,const void* b)
-{
-   const AbstractClassRep::Field* fa = *((const AbstractClassRep::Field**)a);
-   const AbstractClassRep::Field* fb = *((const AbstractClassRep::Field**)b);
-
-   return dStricmp(fa->pFieldname, fb->pFieldname);
-}
-
-ConsoleMethod(SimObject, getDynamicFieldCount, S32, 2, 2, "obj.getDynamicFieldCount()")
-{
-   S32 count = 0;
-   SimFieldDictionary* fieldDictionary = object->getFieldDictionary();
-   for (SimFieldDictionaryIterator itr(fieldDictionary); *itr; ++itr)
-      count++;
-
-   return count;
-}
-
-ConsoleMethod(SimObject, getDynamicField, const char*, 3, 3, "obj.getDynamicField(index)")
-{
-   SimFieldDictionary* fieldDictionary = object->getFieldDictionary();
-   SimFieldDictionaryIterator itr(fieldDictionary);
-   S32 index = dAtoi(argv[2]);
-   for (S32 i = 0; i < index; i++)
-   {
-      if (!(*itr))
-      {
-         Con::warnf("Invalid dynamic field index passed to SimObject::getDynamicField!");
-         return NULL;
-      }
-      ++itr;
-   }
-
-   char* buffer = Con::getReturnBuffer(256);
-   if (*itr)
-   {
-      SimFieldDictionary::Entry* entry = *itr;
-      dSprintf(buffer, 256, "%s", entry->slotName);
-      return buffer;
-   }
-
-   Con::warnf("Invalid dynamic field index passed to SimObject::getDynamicField!");
-   return NULL;
-}
-
-ConsoleMethod( SimObject, getFieldCount, S32, 2, 2, "() - Gets the number of persistent fields on the object." )
-{
-   const AbstractClassRep::FieldList &list = object->getFieldList();
-   const AbstractClassRep::Field* f;
-   U32 numDummyEntries = 0;
-   for(int i = 0; i < list.size(); i++)
-   {
-      f = &list[i];
-
-      if( f->type == AbstractClassRep::DepricatedFieldType ||
-         f->type == AbstractClassRep::StartGroupFieldType ||
-         f->type == AbstractClassRep::EndGroupFieldType )
-      {
-         numDummyEntries++;
-      }
-   }
-
-   return list.size() - numDummyEntries;
-}
-
-ConsoleMethod( SimObject, getField, const char*, 3, 3, "(int index) - Gets the name of the field at the given index." )
-{
-   S32 index = dAtoi( argv[2] );
-   const AbstractClassRep::FieldList &list = object->getFieldList();
-   if( ( index < 0 ) || ( index >= list.size() ) )
-      return "";
-
-   const AbstractClassRep::Field* f;
-   S32 currentField = 0;
-   for(int i = 0; i < list.size() && currentField <= index; i++)
-   {
-      f = &list[i];
-      
-      // skip any dummy fields   
-      if(f->type == AbstractClassRep::DepricatedFieldType ||
-         f->type == AbstractClassRep::StartGroupFieldType ||
-         f->type == AbstractClassRep::EndGroupFieldType)
-      {
-         continue;
-      }
-
-      if(currentField == index)
-         return f->pFieldname;
-      
-      currentField++;
-   }  
-
-   // if we found nada, return nada.
-   return "";
-}
-
-ConsoleMethod(SimObject,dump, void, 2, 2, "() Use the dump method to display the following information about this object: All engine and script registered console methods (including parent methods) for this object, all Non-Dynamic Fields AND all Dynamic Fields\n"
-                                                                "@return No return value")
-{
-   const AbstractClassRep::FieldList &list = object->getFieldList();
-   char expandedBuffer[4096];
-
-   Con::printf("Member Fields:");
-   Vector<const AbstractClassRep::Field *> flist(__FILE__, __LINE__);
-
-   for(U32 i = 0; i < (U32)list.size(); i++)
-      flist.push_back(&list[i]);
-
-   dQsort(flist.address(),flist.size(),sizeof(AbstractClassRep::Field *),compareFields);
-
-   for(Vector<const AbstractClassRep::Field *>::iterator itr = flist.begin(); itr != flist.end(); itr++)
-   {
-      const AbstractClassRep::Field* f = *itr;
-      if( f->type == AbstractClassRep::DepricatedFieldType ||
-          f->type == AbstractClassRep::StartGroupFieldType ||
-          f->type == AbstractClassRep::EndGroupFieldType) continue;
-
-      for(U32 j = 0; S32(j) < f->elementCount; j++)
-      {
-         // [neo, 07/05/2007 - #3000]
-         // Some objects use dummy vars and projected fields so make sure we call the get functions 
-         //const char *val = Con::getData(f->type, (void *) (((const char *)object) + f->offset), j, f->table, f->flag);                          
-         const char *val = (*f->getDataFn)( object, Con::getData(f->type, (void *) (((const char *)object) + f->offset), j, f->table, f->flag) );// + typeSizes[fld.type] * array1));
-
-         if(!val /*|| !*val*/)
-            continue;
-         if(f->elementCount == 1)
-            dSprintf(expandedBuffer, sizeof(expandedBuffer), "  %s = \"", f->pFieldname);
-         else
-            dSprintf(expandedBuffer, sizeof(expandedBuffer), "  %s[%d] = \"", f->pFieldname, j);
-         expandEscape(expandedBuffer + dStrlen(expandedBuffer), val);
-         Con::printf("%s\"", expandedBuffer);
-      }
-   }
-
-   Con::printf("Tagged Fields:");
-   if(object->getFieldDictionary())
-      object->getFieldDictionary()->printFields(object);
-
-   Con::printf("Methods:");
-   Namespace *ns = object->getNamespace();
-   Vector<Namespace::Entry *> vec(__FILE__, __LINE__);
-
-   if(ns)
-      ns->getEntryList(&vec);
-
-   for(Vector<Namespace::Entry *>::iterator j = vec.begin(); j != vec.end(); j++)
-      Con::printf("  %s() - %s", (*j)->mFunctionName, (*j)->mUsage ? (*j)->mUsage : "");
-
-}
-
-
-
-ConsoleMethod(SimObject, getType, S32, 2, 2, "() Use the getType method to get the type for this object. This type is an integer value composed of bitmasks. For simplicity, these bitmasks are defined in the engine and exposed for our use as global variables.\n"
-                                                                "To simplify the writing of scripts, a set of globals has been provided containing the bit setting for each class corresponding to a particular type.\n"
-              "@return Returns a bit mask containing one or more set bits.\n"
-                                                                "@sa getClassName")
-{
-   return((S32)object->getType());
-}
-
-bool SimObject::isMethod( const char* methodName )
-{
-   if( !methodName || !methodName[0] )
-      return false;
-
-   StringTableEntry stname = StringTable->insert( methodName );
-
-   if( getNamespace() )
-      return ( getNamespace()->lookup( stname ) != NULL );
-
-   return false;
-}
-
-ConsoleMethod(SimObject, isMethod, bool, 3, 3, "obj.isMethod(string method name)")
-{
-   return object->isMethod( argv[2] );
-}
-
-
 const char *SimObject::tabComplete(const char *prevText, S32 baseLen, bool fForward)
 const char *SimObject::tabComplete(const char *prevText, S32 baseLen, bool fForward)
 {
 {
    return mNameSpace->tabComplete(prevText, baseLen, fForward);
    return mNameSpace->tabComplete(prevText, baseLen, fForward);
@@ -1257,17 +927,6 @@ bool SimObject::isChildOfGroup(SimGroup* pGroup)
    return false;
    return false;
 }
 }
 
 
-
-ConsoleMethod(SimObject, isChildOfGroup, bool, 3,3," returns true, if we are in the specified simgroup - or a subgroup thereof")
-{
-   SimGroup* pGroup = dynamic_cast<SimGroup*>(Sim::findObject(dAtoi(argv[2])));
-   if(pGroup)
-   {
-      return object->isChildOfGroup(pGroup);
-   }
-
-   return false;
-}
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 
 
 static Chunker<SimObject::Notify> notifyChunker(128000);
 static Chunker<SimObject::Notify> notifyChunker(128000);
@@ -1451,25 +1110,6 @@ SimObject* SimObject::clone( const bool copyDynamicFields )
 }
 }
 
 
 
 
-//-----------------------------------------------------------------------------
-
-ConsoleMethod(SimObject, clone, S32, 2, 3,      "([bool copyDynamicFields? = false]) - Clones the object.\n"
-                                                "@param copyDynamicFields Whether the dynamic fields should be copied to the cloned object or not.  Optional: Defaults to false.\n"
-                                                "@return (newObjectID) The newly cloned object's id if successful, otherwise a 0.")
-{
-    // Fetch copy dynamic fields flag.
-    const bool copyDynamicFields = ( argc >= 3 ) ? dAtob( argv[2] ) : false;
-
-    // Clone Object.
-    SimObject* pClonedObject = object->clone( copyDynamicFields );
-
-    // Finish if object was not cloned.
-    if ( pClonedObject == NULL )
-        return 0;
-
-    return pClonedObject->getId();
-}
-
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
 void SimObject::copyTo(SimObject* object)
 void SimObject::copyTo(SimObject* object)
@@ -1671,119 +1311,3 @@ void SimObject::setSuperClassNamespace( const char *superClassNamespace )
    mSuperClassName = StringTable->insert( superClassNamespace );
    mSuperClassName = StringTable->insert( superClassNamespace );
    linkNamespaces();
    linkNamespaces();
 }
 }
-
-ConsoleMethod(SimObject, getClassNamespace, const char*, 2, 2, "")
-{
-   return object->getClassNamespace();
-}
-
-ConsoleMethod(SimObject, getSuperClassNamespace, const char*, 2, 2, "")
-{
-   return object->getSuperClassNamespace();
-}
-
-ConsoleMethod(SimObject, setClassNamespace, void, 2, 3, "")
-{
-   object->setClassNamespace(argv[2]);
-}
-
-ConsoleMethod(SimObject, setSuperClassNamespace, void, 2, 3, "")
-{
-   object->setSuperClassNamespace(argv[2]);
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleMethod(SimObject, setProgenitorFile, void, 3, 3, "(file) Sets the progenitor file responsible for this instances creation.\n"
-                                                        "@param file The progenitor file responsible for this instances creation.\n"
-                                                        "@return No return value." )
-{
-    object->setProgenitorFile( argv[2] );
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleMethod(SimObject, getProgenitorFile, const char*, 2, 2,  "() Gets the progenitor file responsible for this instances creation.\n"
-                                                                "@return The progenitor file responsible for this instances creation." )
-{
-    return object->getProgenitorFile();
-}
-
-
-//-----------------------------------------------------------------------------
-
-ConsoleMethod(SimObject, startTimer, bool, 4, 5,    "(callbackFunction, float timePeriod, [repeat]) - Starts a periodic timer for this object.\n"
-                                                    "Sets a timer on the object that, when it expires, will cause the object to execute the onTimer() callback.\n"
-                                                    "The timer event will continue to occur at regular intervals until setTimerOff() is called.\n"
-                                                    "@param callbackFunction The name of the callback function to call for each timer repetition.\n"
-                                                    "@param timePeriod The period of time (in milliseconds) between each callback.\n"
-                                                    "@param repeat The number of times the timer should repeat.  If not specified or zero then it will run infinitely\n"
-                                                    "@return No return Value.")
-{
-    // Is the periodic timer running?
-    if ( object->getPeriodicTimerID() != 0 )
-    {
-        // Yes, so cancel it.
-        Sim::cancelEvent( object->getPeriodicTimerID() );
-
-        // Reset Timer ID.
-        object->setPeriodicTimerID( 0 );
-    }
-
-    // Fetch the callback function.
-    StringTableEntry callbackFunction = StringTable->insert( argv[2] );
-
-    // Does the function exist?
-    if ( !object->isMethod( callbackFunction ) )
-    {
-        // No, so warn.
-        Con::warnf("SimObject::startTimer() - The callback function of '%s' does not exist.", callbackFunction );
-        return false;
-    }
-
-    // Fetch the time period.
-    const S32 timePeriod = dAtoi(argv[3]);
-
-    // Is the time period valid?
-    if ( timePeriod < 1 )
-    {
-        // No, so warn.
-        Con::warnf("SimObject::startTimer() - The time period of '%d' is invalid.", timePeriod );
-        return false;
-    }        
-
-    // Fetch the repeat count.
-    const S32 repeat = argc >= 5 ? dAtoi(argv[4]) : 0;
-
-    // Create Timer Event.
-    SimObjectTimerEvent* pEvent = new SimObjectTimerEvent( callbackFunction, (U32)timePeriod, (U32)repeat );
-
-    // Post Event.
-    object->setPeriodicTimerID( Sim::postEvent( object, pEvent, Sim::getCurrentTime() + timePeriod ) );
-
-    return true;
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleMethod(SimObject, stopTimer, void, 2, 2, "() - Stops the periodic timer for this object.\n"
-                                                "@return No return Value.")
-{
-    // Finish if the periodic timer isn't running.
-    if ( object->getPeriodicTimerID() == 0 )
-        return;
-
-    // Cancel It.
-    Sim::cancelEvent( object->getPeriodicTimerID() );
-
-    // Reset Timer ID.
-    object->setPeriodicTimerID( 0 );
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleMethod(SimObject, isTimerActive, bool, 2, 2, "() - Checks whether the periodic timer is active for this object or not.\n"
-                                                    "@return Whether the periodic timer is active for this object or not.")
-{
-    return object->isPeriodicTimerActive();
-}

BIN
engine/source/sim/simObject_ScriptBinding.h


+ 2 - 172
engine/source/sim/simSet.cc

@@ -33,6 +33,8 @@
 #include "console/consoleTypeValidators.h"
 #include "console/consoleTypeValidators.h"
 #include "memory/frameAllocator.h"
 #include "memory/frameAllocator.h"
 
 
+#include "simSet_ScriptBinding.h"
+
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
 // Sim Set
 // Sim Set
 //////////////////////////////////////////////////////////////////////////
 //////////////////////////////////////////////////////////////////////////
@@ -471,175 +473,3 @@ bool SimGroup::processArguments(S32, const char **)
 
 
 IMPLEMENT_CONOBJECT(SimGroup);
 IMPLEMENT_CONOBJECT(SimGroup);
 
 
-//////////////////////////////////////////////////////////////////////////
-// Console Methods
-//////////////////////////////////////////////////////////////////////////
-
-ConsoleMethod(SimSet, listObjects, void, 2, 2, "() Prints the object data within the set\n"
-              "@return No return value")
-{
-   object->lock();
-   SimSet::iterator itr;
-   for(itr = object->begin(); itr != object->end(); itr++)
-   {
-      SimObject *obj = *itr;
-      bool isSet = dynamic_cast<SimSet *>(obj) != 0;
-      const char *name = obj->getName();
-      if(name)
-         Con::printf("   %d,\"%s\": %s %s", obj->getId(), name,
-         obj->getClassName(), isSet ? "(g)":"");
-      else
-         Con::printf("   %d: %s %s", obj->getId(), obj->getClassName(),
-         isSet ? "(g)" : "");
-   }
-   object->unlock();
-}
-
-ConsoleMethod(SimSet, add, void, 3, 0, "(obj1,...) Adds given listy of objects to the SimSet.\n"
-              "@param obj_i (i is unilimited) Variable list of objects to add\n"
-              "@return No return value")
-{
-   for(S32 i = 2; i < argc; i++)
-   {
-      SimObject *obj = Sim::findObject(argv[i]);
-      if(obj)
-         object->addObject(obj);
-      else
-         Con::printf("Set::add: Object \"%s\" doesn't exist", argv[i]);
-   }
-}
-
-ConsoleMethod(SimSet, remove, void, 3, 0, "(obj1,...) Removes given listy of objects from the SimSet.\n"
-              "@param obj_i (i is unilimited) Variable list of objects to remove\n"
-              "@return No return value")
-{
-   for(S32 i = 2; i < argc; i++)
-   {
-      SimObject *obj = Sim::findObject(argv[i]);
-      object->lock();
-      if(obj && object->find(object->begin(),object->end(),obj) != object->end())
-         object->removeObject(obj);
-      else
-         Con::printf("Set::remove: Object \"%s\" does not exist in set", argv[i]);
-      object->unlock();
-   }
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleMethod(SimSet, deleteObjects, void, 2, 2,    "() Deletes all the objects in the SimSet.\n"
-                                                    "@return No return value")
-{
-    object->deleteObjects();
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleMethod(SimSet, clear, void, 2, 2, "() Clears the Simset\n"
-              "@return No return value")
-{
-   object->clear();
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleMethod( SimSet, callOnChildren, void, 3, 0,
-   "( string method, string args... ) Call a method on all objects contained in the set.\n\n"
-   "@param method The name of the method to call.\n"
-   "@param args The arguments to the method.\n\n"
-   "@note This method recurses into all SimSets that are children to the set.\n\n"
-   "@see callOnChildrenNoRecurse" )
-{
-   object->callOnChildren( argv[2], argc - 3, argv + 3 );
-}
-
-//////////////////////////////////////////////////////////////////////////-
-//	Make Sure Child 1 is Ordered Just Under Child 2.
-//////////////////////////////////////////////////////////////////////////-
-ConsoleMethod(SimSet, reorderChild, void, 4,4," (child1, child2) Uses simset reorder to push child 1 before child 2 - both must already be child controls of this control\n"
-              "@param child1 The child you wish to set first\n"
-              "@param child2 The child you wish to set after child1\n"
-              "@return No return value.")
-{
-   SimObject* pObject = Sim::findObject(argv[2]);
-   SimObject* pTarget	 = Sim::findObject(argv[3]);
-
-   if(pObject && pTarget)
-   {
-      object->reOrder(pObject,pTarget);
-   }
-}
-
-ConsoleMethod(SimSet, getCount, S32, 2, 2, "() @return Returns the number of objects in the SimSet")
-{
-   return object->size();
-}
-
-ConsoleMethod(SimSet, getObject, S32, 3, 3, "(objIndex) @return Returns the ID of the desired object or -1 on failure")
-{
-   S32 objectIndex = dAtoi(argv[2]);
-   if(objectIndex < 0 || objectIndex >= S32(object->size()))
-   {
-      Con::printf("Set::getObject index out of range.");
-      return -1;
-   }
-   return ((*object)[objectIndex])->getId();
-}
-
-ConsoleMethod(SimSet, isMember, bool, 3, 3, "(object) @return Returns true if specified object is a member of the set, and false otherwise")
-{
-   SimObject *testObject = Sim::findObject(argv[2]);
-   if(!testObject)
-   {
-      Con::printf("SimSet::isMember: %s is not an object.", argv[2]);
-      return false;
-   }
-
-   object->lock();
-   for(SimSet::iterator i = object->begin(); i != object->end(); i++)
-   {
-      if(*i == testObject)
-      {
-         object->unlock();
-         return true;
-      }
-   }
-   object->unlock();
-
-   return false;
-}
-
-ConsoleMethod( SimSet, findObjectByInternalName, S32, 3, 4, "(string name, [bool searchChildren]) Returns the object with given internal name\n"
-              "@param name The internal name of the object you wish to find\n"
-              "@param searchChildren Set this true if you wish to search all children as well.\n"
-              "@return Returns the ID of the object.")
-{
-
-   StringTableEntry pcName = StringTable->insert(argv[2]);
-   bool searchChildren = false;
-   if (argc > 3)
-      searchChildren = dAtob(argv[3]);
-
-   SimObject* child = object->findObjectByInternalName(pcName, searchChildren);
-   if(child)
-      return child->getId();
-   return 0;
-}
-
-ConsoleMethod(SimSet, bringToFront, void, 3, 3, "(object) Brings object to front of set.\n"
-              "@return No return value.")
-{
-   SimObject *obj = Sim::findObject(argv[2]);
-   if(!obj)
-      return;
-   object->bringObjectToFront(obj);
-}
-
-ConsoleMethod(SimSet, pushToBack, void, 3, 3, "(object) Sends item to back of set.\n"
-              "@return No return value.")
-{
-   SimObject *obj = Sim::findObject(argv[2]);
-   if(!obj)
-      return;
-   object->pushObjectToBack(obj);
-}

BIN
engine/source/sim/simSet_ScriptBinding.h