Skip to content

Class: MockEffector

Mock of a generic X-Ray engine effector class for jest/node.

Remarks

Methods are declared on the prototype rather than as own jest.fn fields on purpose. The engine class is meant to be subclassed with MockEffector.process overridden, and own instance fields would shadow such an override and leave super.process undefined. Use jest.spyOn when call assertions are needed.

Implements

  • effector

Constructors

Constructor

ts
new MockEffector(type: number, time: number): MockEffector;

Parameters

ParameterType
typenumber
timenumber

Returns

MockEffector

Methods

finish()

ts
finish(): void;

Remove the effector from the actor camera stack.

Returns

void

Remarks

Removes by effector type, so sharing a type id with another active effector can remove the wrong effect.

Implementation of

ts
effector.finish

process()

ts
process(params: effector_params): boolean;

Update post-process parameters for the current frame.

Parameters

ParameterTypeDescription
paramseffector_paramsMutable post-process parameters.

Returns

boolean

Whether the effector should continue running.

Remarks

Override this in script. Mutate params for the current frame and return false to stop the effector.

Implementation of

ts
effector.process

start()

ts
start(): void;

Add the effector to the actor camera stack.

Returns

void

Remarks

Requires an active actor. This is intended for in-game actor post-processing, not menu/editor code.

Implementation of

ts
effector.start

create()

ts
static create(type: number, time: number): MockEffector;

Parameters

ParameterType
typenumber
timenumber

Returns

MockEffector


mock()

ts
static mock(type: number, time: number): effector;

Parameters

ParameterType
typenumber
timenumber

Returns

effector

Properties

__name

ts
__name: string = "effector";

LuaBind instance constructor name.

Implementation of

ts
effector.__name

time

ts
time: number;

type

ts
type: number;