Skip to content

Class: MockPropertyEvaluator ​

Mock of the X-Ray engine AI property evaluator.

Extended by ​

Implements ​

  • property_evaluator

Constructors ​

Constructor ​

ts
new MockPropertyEvaluator(object?: game_object | null, name?: string): MockPropertyEvaluator;

Parameters ​

ParameterTypeDefault value
objectgame_object | nullnull
namestring""

Returns ​

MockPropertyEvaluator

Methods ​

evaluate() ​

ts
evaluate(): boolean;

Main evaluator lifecycle method. Called every time to get world property up-to-date state.

Returns ​

boolean

Current evaluator value.

Implementation of ​

ts
property_evaluator.evaluate

setup() ​

ts
setup(object: game_object, storage: property_storage): void;

Handle setup of the evaluator and binding to a specific object.

Parameters ​

ParameterTypeDescription
objectgame_objectTarget client object to work with.
storageproperty_storageAction instance storage with preconditions and state.

Returns ​

void

Remarks ​

Called by the planner when the evaluator is registered. Call it manually only for standalone evaluator tests.

Implementation of ​

ts
property_evaluator.setup

create() ​

ts
static create(object?: game_object | null, name?: string): MockPropertyEvaluator;

Parameters ​

ParameterTypeDefault value
objectgame_object | nullnull
namestring""

Returns ​

MockPropertyEvaluator


mock() ​

ts
static mock(object?: game_object | null, name?: string): property_evaluator;

Parameters ​

ParameterTypeDefault value
objectgame_object | nullnull
namestring""

Returns ​

property_evaluator

Properties ​

__name ​

ts
__name: string;

LuaBind instance constructor name.

Implementation of ​

ts
property_evaluator.__name

object ​

ts
object: game_object;

Linked game object to work with.

Implementation of ​

ts
property_evaluator.object

storage ​

ts
storage: property_storage;

Container reference with state of action preconditions.

Implementation of ​

ts
property_evaluator.storage