Skip to content

Class: MockPropertyEvaluatorConst

Mock of a constant-value AI property evaluator.

Extends

Implements

  • property_evaluator_const

Constructors

Constructor

ts
new MockPropertyEvaluatorConst(value: boolean): MockPropertyEvaluatorConst;

Parameters

ParameterType
valueboolean

Returns

MockPropertyEvaluatorConst

Overrides

MockPropertyEvaluator.constructor

Methods

asMock()

ts
asMock(): property_evaluator;

Returns

property_evaluator


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_const.evaluate

Overrides

MockPropertyEvaluator.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_const.setup

Inherited from

MockPropertyEvaluator.setup


create()

ts
static create(valueOrObject?: boolean | game_object | null, _name?: string): MockPropertyEvaluatorConst;

Parameters

ParameterTypeDefault value
valueOrObjectboolean | game_object | nullfalse
_name?stringundefined

Returns

MockPropertyEvaluatorConst

Overrides

MockPropertyEvaluator.create


mock()

ts
static mock(valueOrObject?: boolean | game_object | null, _name?: string): property_evaluator_const;

Parameters

ParameterTypeDefault value
valueOrObjectboolean | game_object | nullfalse
_name?stringundefined

Returns

property_evaluator_const

Overrides

MockPropertyEvaluator.mock

Properties

__name

ts
__name: string;

LuaBind instance constructor name.

Implementation of

ts
property_evaluator_const.__name

Inherited from

MockPropertyEvaluator.__name


object

ts
object: game_object;

Linked game object to work with.

Implementation of

ts
property_evaluator_const.object

Inherited from

MockPropertyEvaluator.object


storage

ts
storage: property_storage;

Container reference with state of action preconditions.

Implementation of

ts
property_evaluator_const.storage

Inherited from

MockPropertyEvaluator.storage


value

ts
readonly value: boolean;