Browse Source

Minor cleanup on UserData methods

Added Doxygen comments as well.
Mike Lilligreen 11 years ago
parent
commit
e03449a8b1
1 changed files with 23 additions and 14 deletions
  1. 23 14
      engine/source/2d/sceneobject/CompositeSprite_ScriptBinding.h

+ 23 - 14
engine/source/2d/sceneobject/CompositeSprite_ScriptBinding.h

@@ -1019,6 +1019,29 @@ ConsoleMethodWithDocs(CompositeSprite, getSpriteDataObject, ConsoleString, 2, 2,
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
+/*! Set the sprite user data field.
+    @param data A space separated string containing the data you wish to store.
+    @return No return Value.
+*/
+ConsoleMethodWithDocs(CompositeSprite, setSpriteUserData, ConsoleVoid, 3, 3, (data))
+{
+    StringTableEntry userData = StringTable->insert(argv[2]);
+    object->setUserData( (void*)userData );
+}
+
+//-----------------------------------------------------------------------------
+
+/*! Gets the sprite user data.
+    @return The sprite user data.
+*/
+ConsoleMethodWithDocs(CompositeSprite, getSpriteUserData, ConsoleString, 2, 2, ())
+{
+    const char* userData = (const char*) object->getUserData();
+    return userData;
+}
+
+//-----------------------------------------------------------------------------
+
 /*! Set the sprite name.
 /*! Set the sprite name.
     This must be unique within this composite sprite instance.  To clear the name you can pass an empty string.
     This must be unique within this composite sprite instance.  To clear the name you can pass an empty string.
     @return No return Value.
     @return No return Value.
@@ -1050,20 +1073,6 @@ ConsoleMethodWithDocs(CompositeSprite, getSpriteId, ConsoleInt, 2, 2, ())
 
 
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 
 
-ConsoleMethodWithDocs(CompositeSprite, getSpriteUserData, ConsoleString, 2, 2, ())
-{
-    const char* UserDatastr = (const char*) object->getUserData();
-    return UserDatastr;
-}
-
-//-----------------------------------------------------------------------------
-
-ConsoleMethodWithDocs(CompositeSprite, setSpriteUserData, ConsoleVoid, 3, 3, (string))
-{
-    StringTableEntry UserDatastr = StringTable->insert(argv[2]);
-    object->setUserData((void *)UserDatastr);
-}
-
 /*! Picks sprites intersecting the specified point with optional group/layer masks.
 /*! Picks sprites intersecting the specified point with optional group/layer masks.
     @param x/y The coordinate of the point as either (\x y\ or (x,y)
     @param x/y The coordinate of the point as either (\x y\ or (x,y)
     @return Returns list of sprite Ids.
     @return Returns list of sprite Ids.