Difference between revisions of "GetBlob"

From King Arthur's Gold Wiki
Jump to: navigation, search
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<onlyinclude>
 
<onlyinclude>
getBlob will return a referenc to the [[CBlob]] with the given index in the list of currently active blobs.
+
Returns a reference to the [[CBlob]] with the given index in the list of blobs that currently exist.
 
</onlyinclude>
 
</onlyinclude>
<pre>CBlob@ getBlob(u32 index)</pre>
 
  
Probably not required unless looping through all blobs for some reason, in which case something like this might work:
 
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
for ( i = 0; i < [[getBlobsSize]](); i++ )
+
CBlob@ getBlob(u32 index)
{
+
</syntaxhighlight>
[[CBlob]]@ blob = getBlob(i);
+
 
blob->scripts.clear();
+
Probably not required unless looping through all blobs for some reason, in which case something like this might work:
}
+
 
}</syntaxhighlight>
+
<syntaxhighlight lang="cpp" highlight="3">
 +
for ( int i = 0; i < [[getBlobsSize]](); i++ )
 +
{
 +
  CBlob@ blob = getBlob(i);
 +
  // Do something to the blob
 +
}
 +
</syntaxhighlight>
 +
 
 +
[[Category:Scripting]]
 +
[[Category:Global Functions]]

Latest revision as of 18:20, 19 August 2012

Returns a reference to the CBlob with the given index in the list of blobs that currently exist.


CBlob@ getBlob(u32 index)

Probably not required unless looping through all blobs for some reason, in which case something like this might work:

for ( int i = 0; i < [[getBlobsSize]](); i++ )
{
  CBlob@ blob = getBlob(i);  // Do something to the blob
}