Asteroid
Derived Object created based on datafiles. Can be cast to and from an Object@.
Members
-
bool
alwaysVisible
— Whether the object can be seen from any distance.
-
uint
visibleMask
— Empire mask of which empires can see this object.
-
uint
memoryMask
— Empire mask of which empires have any memory of this object.
-
float
sightRange
— Radius around which the object can see other objects.
-
vec3d
position
— Current position in space.
-
vec3d
velocity
— Current momentary velocity.
-
vec3d
acceleration
— Current acceleration vector.
-
uint
donatedVision
— Mask of empires that this object will become visible to.
-
quaterniond
rotation
— Rotation/facing expressed as a quaternion.
-
double
radius
— Radius of the object's bounding sphere and size of its visuals.
-
double
lastTick
— Game time of the last time the object ticked.
-
int
id
— Unique identifier referring to this object.
-
Region@
region
— Member created from datafiles.
-
Component_Orbit@
orbit
— Member created from datafiles.
-
Component_Resources@
resources
— Member created from datafiles.
Methods
-
void
set_name(
string&
Name
)
-
Empire@
get_owner(
) const
-
void
set_owner(
Empire@
emp
)
-
void
finalizeCreation(
)
-
string
get_name(
) const
-
bool
get_valid(
) const
-
bool
get_engaged(
) const
-
bool
get_named(
) const
-
bool
get_inCombat(
) const
-
bool
isFocus(
) const
-
void
focus(
)
-
bool
get_initialized(
) const
-
ObjectType
get_type(
) const
-
bool
get_selected(
) const
-
void
set_selected(
bool
value
)
-
bool
get_isPhysical(
) const
-
void
wake(
)
-
void
sleep(
double
seconds
)
-
bool
get_memorable(
) const
-
void
set_noCollide(
bool
value
)
-
bool
get_noCollide(
) const
-
void
set_engaged(
bool
value
)
-
void
set_named(
bool
value
)
-
void
set_inCombat(
bool
value
)
-
void
wait(
)
-
void
destroy(
)
-
bool
get_destroying(
)
-
void
damage(
DamageEvent&
evt,
double
position,
vec2d&
direction
)
-
void
repair(
double
amount
)
-
void
addTimedEffect(
TimedEffect&
eff
)
-
bool
isVisibleTo(
Empire&
emp
) const
-
bool
isKnownTo(
Empire&
emp
) const
-
Object@
get_targets(
uint
index
) const
-
ObjectGroup@
get_group(
)
-
const ObjectGroup@
get_group(
) const
-
Node@
getNode(
) const
-
vec3d
get_strategicIconPosition(
)
-
uint
getAvailableCount(
)
-
uint
getAvailable(
uint
arg0
)
-
double
getAvailableCost(
uint
arg0
)
-
double
getAvailableCostFor(
uint
arg0
)
-
bool
canDevelop(
const Empire@
arg0
)
-
bool
canGainLimit(
const Empire@
arg0
)
-
void
setup(
const Object@
arg0,
const Empire@
arg1,
uint
arg2
)
-
void
addAvailable(
uint
arg0,
double
arg1
)
-
void
setResourceLimit(
uint
arg0
)
-
void
modResourceLimitMod(
int
arg0
)
-
void
morphTo(
uint
arg0,
double
arg1
)
-
DataList@
getNativeResources(
) const
-
DataList@
getAllResources(
) const
-
uint
get_nativeResourceCount(
) const
-
uint
get_nativeResourceType(
uint
index
) const
-
int
get_nativeResourceId(
uint
index
) const
-
uint
get_nativeResourceTotalLevel(
) const
-
bool
get_nativeResourceUsable(
uint
index
) const
-
bool
get_nativeResourceLocked(
uint
index
)
-
uint
getTradedResourceCount(
) const
-
Object@
get_nativeResourceDestination(
uint
index
) const
-
bool
get_exportEnabled(
) const
-
bool
get_importEnabled(
) const
-
uint
get_resourceModID(
) const
-
bool
isTerraforming(
) const
-
bool
get_hasAutoImports(
) const
-
uint
get_queuedImportCount(
)
-
uint
get_queuedImportType(
uint
i
)
-
Object@
get_queuedImportOrigin(
uint
i
)
-
uint
getImportsOfClass(
uint
cls
) const
-
float
get_resourceVanishRate(
) const
-
uint
get_primaryResourceType(
) const
-
uint
get_primaryResourceLevel(
) const
-
int
get_primaryResourceId(
) const
-
bool
get_primaryResourceUsable(
) const
-
bool
get_primaryResourceLocked(
) const
-
DataList@
getAvailableResources(
) const
-
DataList@
getImportedResources(
) const
-
DataList@
getResourceAmounts(
) const
-
bool
hasImportedResources(
) const
-
uint
get_availableResourceCount(
) const
-
uint
get_availableResourceType(
uint
index
) const
-
bool
get_availableResourceUsable(
uint
index
) const
-
uint
get_usableResourceCount(
) const
-
bool
isResourceAvailable(
uint
id
) const
-
uint
getAvailableResourceAmount(
uint
id
) const
-
Object@
get_availableResourceOrigin(
uint
index
) const
-
void
exportResource(
uint
index,
const Object@
to
)
-
void
exportResourceByID(
int
id,
const Object@
to
)
-
DataList@
getResourcesFor(
const Empire@
emp
) const
-
void
changeResourceOwner(
const Empire@
prevOwner
)
-
void
changeResourceRegion(
const Region@
prevRegion,
const Region@
newRegion
)
-
void
changeResourceTerritory(
const Territory@
prev,
const Territory@
terr
)
-
void
resourceTick(
double
time
)
-
int
addResource(
uint
resourceId
)
-
void
createResource(
uint
resourceId
)
-
uint
getNativeIndex(
int
id
)
-
void
removeResource(
int
id,
bool
wasManual = false
)
-
Object@
getNativeResourceDestination(
const Empire@
forEmpire,
uint
index
) const
-
Object@
getNativeResourceDestinationByID(
const Empire@
forEmpire,
int
id
) const
-
uint
get_nativeResourceByID(
int
id
) const
-
void
addAvailableResource(
const Object@
from,
int
id,
uint
resource,
bool
usable
)
-
void
removeAvailableResource(
const Object@
from,
int
id,
bool
wasManual = false
)
-
void
enableAvailableResource(
const Object@
from,
int
id
)
-
void
disableAvailableResource(
const Object@
from,
int
id,
bool
wasManual = false
)
-
void
setAvailableResourceVanish(
const Object@
from,
int
id,
double
vanishTime
)
-
void
setResourceDisabled(
int
nativeId,
bool
disabled,
bool
wasManual = false
)
-
void
setResourceLocked(
int
nativeId,
bool
locked
)
-
void
addQueuedImport(
const Empire@
forEmpire,
const Object@
from,
int
id,
uint
resource
)
-
void
removeQueuedImport(
const Empire@
forEmpire,
const Object@
from,
int
id
)
-
void
setExportEnabled(
bool
value
)
-
void
setImportEnabled(
bool
value
)
-
void
exportResource(
const Empire@
forEmpire,
uint
index,
const Object@
to
)
-
void
clearExportResource(
int
id
)
-
uint
getResourceTargetLevel(
)
-
void
modPressure(
uint
resource,
int
amount
)
-
void
modDummyResource(
uint
resource,
int
amount,
bool
manual = false
)
-
void
destroyObjResources(
)
-
uint
getUniqueFoodCount(
int
modBy = 0
)
-
void
startTerraform(
)
-
void
stopTerraform(
)
-
void
terraformTo(
uint
resId
)
-
void
modResourceEfficiencyBonus(
double
amt
)
-
void
modResourceVanishBonus(
double
amt
)
-
float
get_resourceEfficiency(
) const
-
void
set_resourceEfficiency(
float
val
)
-
void
enableResources(
)
-
void
disableResources(
)
-
bool
get_areResourcesEnabled(
) const
-
void
setResourceLevel(
uint
level,
bool
wasManual = false
)
-
int
get_resourcePressure(
uint
resource
) const
-
uint
get_resourcesProducing(
uint
resource
) const
-
int
get_totalResourcePressure(
) const
-
bool
writeResourceDelta(
Message&
msg
) const
-
void
writeResources(
Message&
msg
) const
-
void
resourcesPostLoad(
)
-
Civilian@
getAssignedCivilian(
)
-
void
setAssignedCivilian(
const Civilian@
civ
)
-
double
getCivilianTimer(
)
-
void
setCivilianTimer(
double
time
)
-
void
readResourceDelta(
Message&
msg
)
-
void
readResources(
Message&
msg
)
-
Component_Resources@
get_Resources(
)
-
void
orbitTick(
double
time
)
-
void
orbitAround(
vec3d
point
)
-
void
orbitAround(
double
minRadius,
vec3d
point
)
-
void
orbitAround(
vec3d
point,
double
radius
)
-
void
orbitAround(
Object&
around
)
-
void
orbitAround(
Object&
around,
double
radius
)
-
void
orbitAround(
Object&
around,
double
radius,
double
angle
)
-
void
orbitAround(
vec3d
position,
vec3d
origin
)
-
void
orbitSpin(
double
dayLength
)
-
void
setOrbitPct(
double
pct
)
-
void
writeOrbit(
Message&
msg
) const
-
bool
writeOrbitDelta(
Message&
msg
) const
-
Object@
getOrbitingAround(
)
-
void
readOrbit(
Message&
msg
)
-
void
readOrbitDelta(
Message&
msg
)
-
Component_Orbit@
get_Orbit(
)
-
Object@
get_origin(
) const
-
void
set_origin(
Object@
value
)
Empire@
get_owner(
) const
Returns
Empire@
: The empire that owns this 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
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.
void
wake(
)
Tells the processing threads to tick the object next time (ignoring requested timeout)
void
wait(
)
Waits for all asynchronous messages to finish on this object. This is considered a relocking operation.
void
damage(
DamageEvent&
evt,
double
position,
vec2d&
direction
)
Deal damage to the object from a particular direction.
-
DamageEvent&
evt — Event relating information about the damage dealt.
-
double
position — Position between 0 and 1 on the side that is hit.
-
vec2d&
direction — Direction vector towards the object of the damage.
Object@
get_targets(
uint
index
) const
Retrieve one of the targeting system targets the object is holding.
-
uint
index — Index of the object to retrieve (maximum TARGET_COUNT).
Returns
Object@
: Held object by the targetting system.
Node@
getNode(
) const
Returns the node associated with the object. Asynchronous.
Component_Orbit@
get_Orbit(
)
Returns the component handle for this type of component.
Object@
get_origin(
) const
Member created from datafiles.