Difference between revisions of "GetPlayingBlob"

From King Arthur's Gold Wiki
Jump to: navigation, search
(Created page with "<onlyinclude> Returns a reference to the CBlob with the given index in the list of blobs that represent currently active (i.e. spawned, not dead) players. </onlyinclude> <syn...")
 
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<onlyinclude>
 
<onlyinclude>
Returns a reference to the [[CBlob]] with the given index in the list of blobs that represent currently active (i.e. spawned, not dead) players.
+
Returns a reference to the [[CBlob]] with the given index in the list of blobs that are currently active - i.e. not settled map blocks or in inventories.
 
</onlyinclude>
 
</onlyinclude>
<syntaxhighlight lang="cpp">[[CBlob]]@ getPlayingBlob(u32 index)</syntaxhighlight>
 
  
Similar to [[getBlob]], but because this is only for currently active players, this can be useful for doing things to each player.
+
<syntaxhighlight lang="cpp">CBlob@ getPlayingBlob(u32 index)</syntaxhighlight>
Something like the following might therefore be useful:
+
  
<syntaxhighlight lang="cpp">
+
Similar to [[getBlob]], but only for active [[CBlob]]s.
for ( int i = 0; i < [[getPlayingBlobsSize]](); i++ )
+
Usage example:
 +
<syntaxhighlight lang="cpp" highlight="3">
 +
for ( int i = 0; i < getPlayingBlobsSize(); i++ )
 
{
 
{
   [[CBlob]]@ blob = getPlayingBlob(i);
+
   CBlob@ blob = getPlayingBlob(i);
   // Do something to this player
+
   // Do something to this blob
 
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 21:03, 19 August 2012

Returns a reference to the CBlob with the given index in the list of blobs that are currently active - i.e. not settled map blocks or in inventories.


CBlob@ getPlayingBlob(u32 index)

Similar to getBlob, but only for active CBlobs. Usage example:

for ( int i = 0; i < getPlayingBlobsSize(); i++ )
{
  CBlob@ blob = getPlayingBlob(i);  // Do something to this blob
}