Difference between revisions of "Component::getBlob"

From King Arthur's Gold Wiki
Jump to: navigation, search
 
Line 19: Line 19:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 +
Object method of: [[CInventory]], [[CAttachment]], [[CBrain]], [[CMovement]], [[CShape]], [[CWeapon]]
 
[[Category:Scripting]]
 
[[Category:Scripting]]
 
[[Category:Object Methods]]
 
[[Category:Object Methods]]

Latest revision as of 19:53, 19 August 2012

Returns a reference to the CBlob that owns this object. It is a method common to several object types that are considered 'components'.


This very simple method is useful anywhere you want to perform some action on the CBlob that owns the component you're working with rather than the component itself.

CBlob@ getBlob()

Example from Entities/Characters/Scripts/BuilderInventory.as:

if (this.hasRequirements( reqs, missing ))
{
  this.TakeRequirements( reqs );
  CBlob @shopBlob = CreateBlob( "genericblock", "Entities/Workshops/Base/WorkshopWAR.cfg", 0, this.getBlob().getPosition() );
  this.getBlob().Pickup( shopBlob, false );}

Object method of: CInventory, CAttachment, CBrain, CMovement, CShape, CWeapon