externalabstractInitialisable
Index
Constructors
Methods
Constructors
externalconstructor
Returns Initialisable
Methods
staticexternalisInitialisable
Type parameters
- T
Parameters
externalvalue: T
Returns value is T & Initialisable
externalabstractinitialise
Initialises the ability. Invoked whenever
Actor.attemptsTomethod is called, but only whenInitialisable.isInitialisedreturns false.Make sure to implement
Initialisable.isInitialisedso that it returnstruewhen the ability has been successfully initialised.Returns void | Promise<void>
externalabstractisInitialised
Should return
truewhen all the resources that the given ability needs have been initialised. Should returnfalseif theActorshould initialise them again whenActor.attemptsTois called.Returns boolean
An interface to be implemented by any
Abilitythat needs to initialise the resources it uses, e.g. establish a database connection.The
Initialisable.initialisemethod is invoked wheneverActor.attemptsTomethod is called, but only whenInitialisable.isInitialisedreturns false. This is to avoid initialising abilities more than once.Learn more
AbilityAbilityTypeDiscardable