Class: MockAlifeOnlineOfflineGroup
Class mocking generic server offline-online group.
Extends
Implements
cse_alife_online_offline_group
Accessors
__name
Get Signature
get __name(): string;Returns
string
Implementation of
cse_alife_online_offline_group.__nameInherited from
__name
Get Signature
get static __name(): string;Returns
string
Inherited from
Constructors
Constructor
new MockAlifeOnlineOfflineGroup(config?:
| string
| IMockAlifeObjectConfig): MockAlifeOnlineOfflineGroup;Parameters
| Parameter | Type |
|---|---|
config | | string | IMockAlifeObjectConfig |
Returns
MockAlifeOnlineOfflineGroup
Inherited from
MockAlifeDynamicObject.constructor
Methods
addMember()
addMember(): void;Returns
void
asMock()
asMock(): cse_alife_online_offline_group;Returns
cse_alife_online_offline_group
assignToTerrain()
assignToTerrain(): void;Returns
void
can_save()
can_save(): boolean;Returns
boolean
Whether this object should be saved.
Implementation of
cse_alife_online_offline_group.can_saveInherited from
MockAlifeDynamicObject.can_save
can_switch_offline()
Call Signature
can_switch_offline(): boolean;Returns
boolean
Whether this object may switch offline.
Implementation of
cse_alife_online_offline_group.can_switch_offlineInherited from
MockAlifeDynamicObject.can_switch_offline
Call Signature
can_switch_offline(value: boolean): void;Allow or block switching offline.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether offline switching is allowed. |
Returns
void
Remarks
Sets the object's switch-offline flag; it does not switch the object immediately.
Implementation of
cse_alife_online_offline_group.can_switch_offlineInherited from
MockAlifeDynamicObject.can_switch_offline
can_switch_online()
Call Signature
can_switch_online(): boolean;Returns
boolean
Whether this object may switch online.
Implementation of
cse_alife_online_offline_group.can_switch_onlineInherited from
MockAlifeDynamicObject.can_switch_online
Call Signature
can_switch_online(value: boolean): void;Allow or block switching online.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether online switching is allowed. |
Returns
void
Remarks
Sets the object's switch-online flag; it does not switch the object immediately.
Implementation of
cse_alife_online_offline_group.can_switch_onlineInherited from
MockAlifeDynamicObject.can_switch_online
clsid()
clsid(): TXR_class_id;Returns
TXR_class_id
Engine class id.
Implementation of
cse_alife_online_offline_group.clsidInherited from
commander_id()
commander_id(): number;Get current squad command ID.
Returns
number
First member id, or 65535 when the group is empty.
Implementation of
cse_alife_online_offline_group.commander_idFillProps()
FillProps(_pref: string, _items: prop_item_vec): void;Fill editor property rows for this object.
Parameters
| Parameter | Type |
|---|---|
_pref | string |
_items | prop_item_vec |
Returns
void
Implementation of
cse_alife_online_offline_group.FillPropsInherited from
MockAlifeDynamicObject.FillProps
get_current_task()
get_current_task(): CALifeSmartTerrainTask;Returns
CALifeSmartTerrainTask
Current smart terrain task, when one is assigned.
Throws
The base online/offline group implementation does not provide a task.
Implementation of
cse_alife_online_offline_group.get_current_taskgetScriptedSimulationTarget()
getScriptedSimulationTarget(): void;Returns
void
init()
init(): cse_alife_object;Initialize the ALife object and return its abstract base.
Returns
cse_alife_object
Initialized abstract entity.
Implementation of
cse_alife_online_offline_group.initInherited from
interactive()
interactive(): boolean;Returns
boolean
Whether the object is interactive.
Implementation of
cse_alife_online_offline_group.interactiveInherited from
MockAlifeDynamicObject.interactive
keep_saved_data_anyway()
keep_saved_data_anyway(): boolean;Returns
boolean
Implementation of
cse_alife_online_offline_group.keep_saved_data_anywayInherited from
MockAlifeDynamicObject.keep_saved_data_anyway
move_offline()
Call Signature
move_offline(): boolean;Returns
boolean
Whether the object should move while offline.
Implementation of
cse_alife_online_offline_group.move_offlineInherited from
MockAlifeDynamicObject.move_offline
Call Signature
move_offline(value: boolean): void;Set whether the object should move while offline.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether offline movement is enabled. |
Returns
void
Implementation of
cse_alife_online_offline_group.move_offlineInherited from
MockAlifeDynamicObject.move_offline
name()
name<T>(): T;Type Parameters
| Type Parameter |
|---|
T extends string |
Returns
T
Runtime object name.
Implementation of
cse_alife_online_offline_group.nameInherited from
on_before_register()
on_before_register(): void;Returns
void
Implementation of
cse_alife_online_offline_group.on_before_registerInherited from
MockAlifeDynamicObject.on_before_register
on_register()
on_register(): void;Returns
void
Implementation of
cse_alife_online_offline_group.on_registerInherited from
MockAlifeDynamicObject.on_register
on_spawn()
on_spawn(): void;Returns
void
Implementation of
cse_alife_online_offline_group.on_spawnInherited from
MockAlifeDynamicObject.on_spawn
on_unregister()
on_unregister(): void;Returns
void
Implementation of
cse_alife_online_offline_group.on_unregisterInherited from
MockAlifeDynamicObject.on_unregister
register_member()
register_member(id: number): void;Add an object to this online/offline group.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | number | Server object id. |
Returns
void
Remarks
The id must resolve to a live monster server object that is not already in this group.
Throws
If the member is already registered, is not a monster, or is not alive.
Implementation of
cse_alife_online_offline_group.register_membersection_name()
section_name<T>(): T;Type Parameters
| Type Parameter |
|---|
T extends string |
Returns
T
Spawn section name.
Implementation of
cse_alife_online_offline_group.section_nameInherited from
MockAlifeDynamicObject.section_name
STATE_Read()
STATE_Read(packet: net_packet, size: number): void;Read a state packet into this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
packet | net_packet | Source network packet. |
size | number | Serialized state size. |
Returns
void
Remarks
Use only with packets written for the same server object class and state format.
Implementation of
cse_alife_online_offline_group.STATE_ReadInherited from
MockAlifeDynamicObject.STATE_Read
STATE_Write()
STATE_Write(packet: net_packet): void;Write a state packet from this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
packet | net_packet | Target network packet. |
Returns
void
Implementation of
cse_alife_online_offline_group.STATE_WriteInherited from
MockAlifeDynamicObject.STATE_Write
switch_offline()
switch_offline(): void;Mark the server object offline.
Returns
void
Source
src/xrGame/alife_dynamic_object.cpp, CSE_ALifeDynamicObject::switch_offline.
Remarks
Requires the object to be online. The base implementation marks it offline, removes it from the online ALife set, and clears client data unless keep_saved_data_anyway() returns true.
Implementation of
cse_alife_online_offline_group.switch_offlineInherited from
MockAlifeDynamicObject.switch_offline
switch_online()
switch_online(): void;Mark the server object online.
Returns
void
Source
src/xrGame/alife_dynamic_object.cpp, CSE_ALifeDynamicObject::switch_online.
Remarks
Requires the object to be offline. The base implementation marks it online and adds it to the online ALife set. Use the simulator switch manager for normal distance-based switching.
Implementation of
cse_alife_online_offline_group.switch_onlineInherited from
MockAlifeDynamicObject.switch_online
unregister_member()
unregister_member(id: number): void;Remove an object from this online/offline group.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | number | Server object id. |
Returns
void
Throws
If the id is not a member of this group.
Implementation of
cse_alife_online_offline_group.unregister_memberUPDATE_Read()
UPDATE_Read(packet: net_packet): void;Read an update packet into this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
packet | net_packet | Source network packet. |
Returns
void
Remarks
Use only with packets written for the same server object class and update format.
Implementation of
cse_alife_online_offline_group.UPDATE_ReadInherited from
MockAlifeDynamicObject.UPDATE_Read
UPDATE_Write()
UPDATE_Write(packet: net_packet): void;Write an update packet from this object.
Parameters
| Parameter | Type | Description |
|---|---|---|
packet | net_packet | Target network packet. |
Returns
void
Implementation of
cse_alife_online_offline_group.UPDATE_WriteInherited from
MockAlifeDynamicObject.UPDATE_Write
use_ai_locations()
use_ai_locations(value: boolean): void;Enable or disable AI location graph use.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether AI locations should be used. |
Returns
void
Implementation of
cse_alife_online_offline_group.use_ai_locationsInherited from
MockAlifeDynamicObject.use_ai_locations
used_ai_locations()
used_ai_locations(): boolean;Returns
boolean
Whether the object uses AI location graph data.
Implementation of
cse_alife_online_offline_group.used_ai_locationsInherited from
MockAlifeDynamicObject.used_ai_locations
visible_for_map()
Call Signature
visible_for_map(): boolean;Returns
boolean
Whether the object is visible on the map.
Implementation of
cse_alife_online_offline_group.visible_for_mapInherited from
MockAlifeDynamicObject.visible_for_map
Call Signature
visible_for_map(value: boolean): void;Set whether the object is visible on the map.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | boolean | Whether the object should be shown on the map. |
Returns
void
Implementation of
cse_alife_online_offline_group.visible_for_mapInherited from
MockAlifeDynamicObject.visible_for_map
create()
static create(config?: IMockAlifeObjectConfig): MockAlifeOnlineOfflineGroup;Parameters
| Parameter | Type |
|---|---|
config | IMockAlifeObjectConfig |
Returns
MockAlifeOnlineOfflineGroup
Overrides
mock()
static mock(config?: IMockAlifeObjectConfig): cse_alife_online_offline_group;Parameters
| Parameter | Type |
|---|---|
config | IMockAlifeObjectConfig |
Returns
cse_alife_online_offline_group
Overrides
mockWithClassId()
static mockWithClassId(classId: number): cse_alife_object;Parameters
| Parameter | Type |
|---|---|
classId | number |
Returns
cse_alife_object
Inherited from
MockAlifeDynamicObject.mockWithClassId
toMock()
static toMock(object: cse_alife_object): MockAlifeObject;Parameters
| Parameter | Type |
|---|---|
object | cse_alife_object |
Returns
Inherited from
Properties
add_location_type
add_location_type: Mock<() => void>;Add a location type accepted by the group.
Remarks
Adds the terrain mask to the group and to every current member.
Param
location
Location type name.
Implementation of
cse_alife_online_offline_group.add_location_typealive
alive: Mock<() => boolean>;Inherited from
angle
angle: vector;Server-side orientation angles.
Implementation of
cse_alife_online_offline_group.angleInherited from
canSave
canSave: boolean;Inherited from
MockAlifeDynamicObject.canSave
canSwitchOffline
canSwitchOffline: boolean;Inherited from
MockAlifeDynamicObject.canSwitchOffline
canSwitchOnline
canSwitchOnline: boolean;Inherited from
MockAlifeDynamicObject.canSwitchOnline
classId
classId: TXR_class_id;Inherited from
MockAlifeDynamicObject.classId
clear_location_types
clear_location_types: Mock<() => void>;Remove all location type filters from the group.
Remarks
Clears the terrain masks on the group and on every current member.
Implementation of
cse_alife_online_offline_group.clear_location_typesclear_smart_terrain
clear_smart_terrain: Mock<UnknownFunction>;Inherited from
MockAlifeDynamicObject.clear_smart_terrain
community
community: <T>() => T;Type Parameters
| Type Parameter | Default type |
|---|---|
T extends string | string |
Returns
T
Inherited from
MockAlifeDynamicObject.community
faction
faction: TDefaultCommunity;force_change_position
force_change_position: Mock<() => void>;Force the group's graph position from a world position.
Remarks
Recomputes level and game graph vertices from vector.
Param
vector
Target world position.
Implementation of
cse_alife_online_offline_group.force_change_positionforce_set_goodwill
force_set_goodwill: Mock<UnknownFunction>;id
id: number;Server object id.
Implementation of
cse_alife_online_offline_group.idInherited from
invulnerable
invulnerable: TConditionList;isInteractive
isInteractive: boolean;Inherited from
MockAlifeDynamicObject.isInteractive
isVisibleForMap
isVisibleForMap: boolean;Inherited from
MockAlifeDynamicObject.isVisibleForMap
m_game_vertex_id
m_game_vertex_id: number;Game graph vertex used by ALife simulation.
Implementation of
cse_alife_online_offline_group.m_game_vertex_idInherited from
MockAlifeDynamicObject.m_game_vertex_id
m_level_vertex_id
m_level_vertex_id: number;Level graph vertex used by ALife simulation.
Implementation of
cse_alife_online_offline_group.m_level_vertex_idInherited from
MockAlifeDynamicObject.m_level_vertex_id
m_story_id
m_story_id: number;Always numeric value. Returns maximal u32 (4294967295) value if object has no story id.
Implementation of
cse_alife_online_offline_group.m_story_idInherited from
MockAlifeDynamicObject.m_story_id
members
members: IXR_squad_member<cse_alife_creature_abstract>[] = [];npc_count
npc_count: Mock<() => number>;Returns
Number of NPCs in the group.
Implementation of
cse_alife_online_offline_group.npc_countobject
object: cse_alife_creature_abstract;Current member object exposed during squad member iteration.
Implementation of
cse_alife_online_offline_group.objectobjectAlive
objectAlive: boolean;Inherited from
MockAlifeDynamicObject.objectAlive
objectCommunity
objectCommunity: string;Inherited from
MockAlifeDynamicObject.objectCommunity
objectName
objectName: string;Inherited from
MockAlifeDynamicObject.objectName
online
online: boolean;Whether server object has client representation and is in online mode.
Implementation of
cse_alife_online_offline_group.onlineInherited from
parent_id
parent_id: number;Parent server object id, or 65535 when there is no parent.
Implementation of
cse_alife_online_offline_group.parent_idInherited from
MockAlifeDynamicObject.parent_id
position
position: vector;Server-side world position.
Implementation of
cse_alife_online_offline_group.positionInherited from
MockAlifeDynamicObject.position
script_version
script_version: number;Script data version stored with this object.
Implementation of
cse_alife_online_offline_group.script_versionInherited from
MockAlifeDynamicObject.script_version
section
section: string;Inherited from
MockAlifeDynamicObject.section
shouldMoveOffline
shouldMoveOffline: boolean;Inherited from
MockAlifeDynamicObject.shouldMoveOffline
spawn_ini
spawn_ini: Mock<() => ini_file | null>;Returns
Spawn ini attached to this object, if any.
Implementation of
cse_alife_online_offline_group.spawn_iniInherited from
MockAlifeDynamicObject.spawn_ini
spawnIni
spawnIni: ini_file | null;Inherited from
MockAlifeDynamicObject.spawnIni
squad_members
squad_members: Mock<() => LuaIterable<IXR_squad_member<cse_alife_creature_abstract>>>;Iterate over group members.
Returns
Lua iterator of squad member records.
Implementation of
cse_alife_online_offline_group.squad_membersupdate
update: Mock<UnknownFunction>;Run the server-side ALife update for this object.
Implementation of
cse_alife_online_offline_group.updateInherited from
usesAiLocations
usesAiLocations: boolean;