Object

Abstract class for all game objects, implemented by various subclasses using different states and components. Note that not all methods listed here are accessible on all objects, so before using a component call, check whether the object has the right component for that call using the has[Component] accessors.

Members

Methods

void set_name( string& Name )

Empire@ get_owner( ) const

Returns Empire@ : The empire that owns this object.

void set_owner( Empire@ emp )

Set a new owner for the object.

void finalizeCreation( )

Finalize the creation of this object. Should only be called on objects that were created with delayedCreation set to true.

string get_name( ) const

Returns string : Name of the object.

bool get_valid( ) const

Returns bool : Whether the object is valid and not a zombie. Zombies are objects that have already been destroyed but are awaiting disposal.

bool get_engaged( ) const

Returns bool : Whether the object is engaged.

bool get_named( ) const

Returns bool : Whether the object has been named..

bool get_inCombat( ) const

Returns bool : Whether the object is considered in combat.

bool isFocus( ) const

Returns bool : Whether the object is a focus object. Focus objects have higher priority for interpolation and syncing.

void focus( )

Mark the object as a focus object. Focus decays and should be set periodically on accessed objects.

bool get_initialized( ) const

Returns bool : Whether the object has been fully initialized in its creation step.

ObjectType get_type( ) const

Returns ObjectType : The type of this object.

bool get_selected( ) const

Returns bool : Whether the object is currently selected.

void set_selected( bool value )

bool get_isPhysical( ) const

Returns bool : Whether the object is a physical object.

void wake( )

Tells the processing threads to tick the object next time (ignoring requested timeout)

void sleep( double seconds )

Adds a number of seconds to the object's requested timeout.

bool get_memorable( ) const

Returns bool : Whether the object should have past vision state tracked.

void set_noCollide( bool value )

Set whether the object should not be collided with (enforced by scripts).

bool get_noCollide( ) const

Returns bool : Whether the object should not be collided with.

void set_engaged( bool value )

Set whether the object is engaged.

void set_named( bool value )

Set whether the object is named.

void set_inCombat( bool value )

Set whether the object is considered in combat.

void wait( )

Waits for all asynchronous messages to finish on this object. This is considered a relocking operation.

void destroy( )

Flag the object for destruction and eventual disposal.

bool get_destroying( )

Whether the object is waiting to be destroyed.

void damage( DamageEvent& evt, double position, vec2d& direction )

Deal damage to the object from a particular direction.

void addTimedEffect( TimedEffect& eff )

Add an effect to the object that executes then finishes after a particular amount of time.

bool isVisibleTo( Empire& emp ) const

Returns true if the specified empire can see the object.

bool isKnownTo( Empire& emp ) const

Returns true if the specified empire has ever seen the object.

Object@ get_targets( uint index ) const

Retrieve one of the targeting system targets the object is holding. Returns Object@ : Held object by the targetting system.

ObjectGroup@ get_group( )

Returns ObjectGroup@ : The object group associated with the object.

const ObjectGroup@ get_group( ) const

Returns const ObjectGroup@ : The object group associated with the object.

Node@ getNode( ) const

Returns the node associated with the object. Asynchronous.

bool get_hasAbilities( ) const

Returns true if the object has the associated component.

Component_Abilities@ get_Abilities( )

Returns the component handle for this type of component. Returns Component_Abilities@ : Can be null if no component of this type exists for this object.

bool get_hasConstruction( ) const

Returns true if the object has the associated component.

Component_Construction@ get_Construction( )

Returns the component handle for this type of component. Returns Component_Construction@ : Can be null if no component of this type exists for this object.

bool get_hasLeaderAI( ) const

Returns true if the object has the associated component.

Component_LeaderAI@ get_LeaderAI( )

Returns the component handle for this type of component. Returns Component_LeaderAI@ : Can be null if no component of this type exists for this object.

bool get_hasMover( ) const

Returns true if the object has the associated component.

Component_Mover@ get_Mover( )

Returns the component handle for this type of component. Returns Component_Mover@ : Can be null if no component of this type exists for this object.

bool get_hasResources( ) const

Returns true if the object has the associated component.

Component_Resources@ get_Resources( )

Returns the component handle for this type of component. Returns Component_Resources@ : Can be null if no component of this type exists for this object.

bool get_hasOrbit( ) const

Returns true if the object has the associated component.

Component_Orbit@ get_Orbit( )

Returns the component handle for this type of component. Returns Component_Orbit@ : Can be null if no component of this type exists for this object.

bool get_hasPickupControl( ) const

Returns true if the object has the associated component.

Component_PickupControl@ get_PickupControl( )

Returns the component handle for this type of component. Returns Component_PickupControl@ : Can be null if no component of this type exists for this object.

bool get_hasRegionObjects( ) const

Returns true if the object has the associated component.

Component_RegionObjects@ get_RegionObjects( )

Returns the component handle for this type of component. Returns Component_RegionObjects@ : Can be null if no component of this type exists for this object.

bool get_hasStatuses( ) const

Returns true if the object has the associated component.

Component_Statuses@ get_Statuses( )

Returns the component handle for this type of component. Returns Component_Statuses@ : Can be null if no component of this type exists for this object.

bool get_hasSupportAI( ) const

Returns true if the object has the associated component.

Component_SupportAI@ get_SupportAI( )

Returns the component handle for this type of component. Returns Component_SupportAI@ : Can be null if no component of this type exists for this object.

bool get_hasSurfaceComponent( ) const

Returns true if the object has the associated component.

Component_SurfaceComponent@ get_SurfaceComponent( )

Returns the component handle for this type of component. Returns Component_SurfaceComponent@ : Can be null if no component of this type exists for this object.