Difference between revisions of "CBlob::exists"

From King Arthur's Gold Wiki
Jump to: navigation, search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<onlyinclude>
 
<onlyinclude>
Returns a a bool indicating whether or not this blob has given property.
+
Returns a bool indicating whether or not this blob has given property.
 
</onlyinclude>
 
</onlyinclude>
  
Normally you want to use this to make sure that blob has a property initialized, which you want to use.
+
Normally you want to use this to make sure that blob has a specific property initialized, which you want to read.
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
 
bool exists(const string &in)
 
bool exists(const string &in)
Line 9: Line 9:
  
  
Example from C:\KagScripting\Base\Entities\Common\FireScripts\HOTHOTHOT.as
+
Example from Base\Entities\Common\FireScripts\HOTHOTHOT.as
 
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
 
if (blob.getProperties().exists("burn_time"))
 
if (blob.getProperties().exists("burn_time"))

Latest revision as of 00:10, 29 September 2012

Returns a bool indicating whether or not this blob has given property.


Normally you want to use this to make sure that blob has a specific property initialized, which you want to read.

bool exists(const string &in)


Example from Base\Entities\Common\FireScripts\HOTHOTHOT.as

if (blob.getProperties().exists("burn_time"))
{
     u8 burn_time = blob.getProperties().get_u8("burn_time");
     ...
}

Object method of: CBlob