PopulateBlobsByNameList

From King Arthur's Gold Wiki
Revision as of 21:04, 20 August 2012 by Shadlington (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Populates the 'Blobs By Name List' with all of the CBlobs that currently exist with the given name.


When you use this function, a list will have references to all of the CBlobs that currently exist with the given name put into it. You can't modify this list directly, but you can use the functions getBlobsByNameListSize and getBlobsByNameListBlob to do things with the CBlobs listed.

void populateBlobsByNameList(const string &blobName)

Example from Rules/Scripts/WAR_Players.as:

// gather all tents and select assigned team's tent
CBlob@ tent;
populateBlobsByNameList( "tent" ); 
for (int i=0; i < getBlobsByNameListSize(); i++)
{
  CBlob@ blob = getBlobsByNameListBlob(i);
  if (blob.getTeamNum() == assignedTeamNum)
  {	
    @tent = blob; 		
    break;
  }
}