Class: MockAlifeObject
Mock base alife object implementation.
Extends
Extended by
Implements
cse_alife_object
Accessors
__name
Get Signature
get __name(): string;Returns
string
Implementation of
cse_alife_object.__nameInherited from
__name
Get Signature
get static __name(): string;Returns
string
Inherited from
Constructors
Constructor
new MockAlifeObject(config?:
| string
| IMockAlifeObjectConfig): MockAlifeObject;Parameters
| Parameter | Type |
|---|---|
config | | string | IMockAlifeObjectConfig |
Returns
MockAlifeObject
Overrides
Methods
can_save()
can_save(): boolean;Returns
boolean
Whether this object should be saved.
Implementation of
cse_alife_object.can_savecan_switch_offline()
Call Signature
can_switch_offline(): boolean;Returns
boolean
Whether this object may switch offline.
Implementation of
cse_alife_object.can_switch_offlineCall 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_object.can_switch_offlinecan_switch_online()
Call Signature
can_switch_online(): boolean;Returns
boolean
Whether this object may switch online.
Implementation of
cse_alife_object.can_switch_onlineCall 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_object.can_switch_onlineclsid()
clsid(): TXR_class_id;Returns
TXR_class_id
Engine class id.
Implementation of
cse_alife_object.clsidFillProps()
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_object.FillPropsinit()
init(): cse_alife_object;Initialize the ALife object and return its abstract base.
Returns
cse_alife_object
Initialized abstract entity.
Implementation of
cse_alife_object.initinteractive()
interactive(): boolean;Returns
boolean
Whether the object is interactive.
Implementation of
cse_alife_object.interactivekeep_saved_data_anyway()
keep_saved_data_anyway(): boolean;Returns
boolean
move_offline()
Call Signature
move_offline(): boolean;Returns
boolean
Whether the object should move while offline.
Implementation of
cse_alife_object.move_offlineCall 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_object.move_offlinename()
name<T>(): T;Type Parameters
| Type Parameter |
|---|
T extends string |
Returns
T
Runtime object name.
Implementation of
cse_alife_object.nameon_before_register()
on_before_register(): void;Returns
void
on_register()
on_register(): void;Returns
void
on_spawn()
on_spawn(): void;Returns
void
on_unregister()
on_unregister(): void;Returns
void
section_name()
section_name<T>(): T;Type Parameters
| Type Parameter |
|---|
T extends string |
Returns
T
Spawn section name.
Implementation of
cse_alife_object.section_nameSTATE_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_object.STATE_ReadSTATE_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_object.STATE_Writeupdate()
update(): void;Declared on the prototype rather than as an own jest.fn() field.
Returns
void
Remarks
Server objects override update and call super.update(). An own instance field is installed by this constructor before the subclass body runs, so it would shadow the subclass override entirely and leave super.update undefined. Spy on it with jest.spyOn(object, "update") when call assertions are needed.
Implementation of
cse_alife_object.updateUPDATE_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_object.UPDATE_ReadUPDATE_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_object.UPDATE_Writeuse_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_object.use_ai_locationsused_ai_locations()
used_ai_locations(): boolean;Returns
boolean
Whether the object uses AI location graph data.
Implementation of
cse_alife_object.used_ai_locationsvisible_for_map()
Call Signature
visible_for_map(): boolean;Returns
boolean
Whether the object is visible on the map.
Implementation of
cse_alife_object.visible_for_mapCall 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_object.visible_for_mapcreate()
static create(config?: IMockAlifeObjectConfig): MockAlifeObject;Parameters
| Parameter | Type |
|---|---|
config | IMockAlifeObjectConfig |
Returns
MockAlifeObject
Overrides
mock()
static mock(config?: IMockAlifeObjectConfig): cse_alife_object;Parameters
| Parameter | Type |
|---|---|
config | IMockAlifeObjectConfig |
Returns
cse_alife_object
Overrides
mockWithClassId()
static mockWithClassId(classId: number): cse_alife_object;Parameters
| Parameter | Type |
|---|---|
classId | number |
Returns
cse_alife_object
toMock()
static toMock(object: cse_alife_object): MockAlifeObject;Parameters
| Parameter | Type |
|---|---|
object | cse_alife_object |
Returns
MockAlifeObject
Properties
alive
alive: Mock<() => boolean>;angle
angle: vector;Server-side orientation angles.
Implementation of
cse_alife_object.anglecanSave
canSave: boolean;canSwitchOffline
canSwitchOffline: boolean;canSwitchOnline
canSwitchOnline: boolean;classId
classId: TXR_class_id;clear_smart_terrain
clear_smart_terrain: Mock<UnknownFunction>;community
community: <T>() => T;Type Parameters
| Type Parameter | Default type |
|---|---|
T extends string | string |
Returns
T
id
id: number;Server object id.
Implementation of
cse_alife_object.idisInteractive
isInteractive: boolean;isVisibleForMap
isVisibleForMap: boolean;m_game_vertex_id
m_game_vertex_id: number;Game graph vertex used by ALife simulation.
Implementation of
cse_alife_object.m_game_vertex_idm_level_vertex_id
m_level_vertex_id: number;Level graph vertex used by ALife simulation.
Implementation of
cse_alife_object.m_level_vertex_idm_story_id
m_story_id: number;Always numeric value. Returns maximal u32 (4294967295) value if object has no story id.
Implementation of
cse_alife_object.m_story_idobjectAlive
objectAlive: boolean;objectCommunity
objectCommunity: string;objectName
objectName: string;online
online: boolean;Whether server object has client representation and is in online mode.
Implementation of
cse_alife_object.onlineparent_id
parent_id: number;Parent server object id, or 65535 when there is no parent.
Implementation of
cse_alife_object.parent_idposition
position: vector;Server-side world position.
Implementation of
cse_alife_object.positionscript_version
script_version: number;Script data version stored with this object.
Implementation of
cse_alife_object.script_versionsection
section: string;shouldMoveOffline
shouldMoveOffline: boolean;spawn_ini
spawn_ini: Mock<() => ini_file | null>;Returns
Spawn ini attached to this object, if any.
Implementation of
cse_alife_object.spawn_inispawnIni
spawnIni: ini_file | null;usesAiLocations
usesAiLocations: boolean;