Cancelable companion resource

This commit is contained in:
Alexis Faizeau 2022-02-02 11:10:52 +01:00
parent 9696b0ab04
commit 4a9cc57d60
5 changed files with 16 additions and 8 deletions

View file

@ -59,7 +59,7 @@ export abstract class Character extends Container implements OutlineableInterfac
frame: string | number,
isClickable: boolean,
companion: string | null,
companionTexturePromise?: Promise<string>
companionTexturePromise?: CancelablePromise<string>
) {
super(scene, x, y /*, texture, frame*/);
this.scene = scene;
@ -179,7 +179,7 @@ export abstract class Character extends Container implements OutlineableInterfac
});
}
public addCompanion(name: string, texturePromise?: Promise<string>): void {
public addCompanion(name: string, texturePromise?: CancelablePromise<string>): void {
if (typeof texturePromise !== "undefined") {
this.companion = new Companion(this.scene, this.x, this.y, name, texturePromise);
}

View file

@ -31,7 +31,7 @@ export class RemotePlayer extends Character implements ActivatableInterface {
moving: boolean,
visitCardUrl: string | null,
companion: string | null,
companionTexturePromise?: Promise<string>,
companionTexturePromise?: CancelablePromise<string>,
activationRadius?: number
) {
super(Scene, x, y, texturesPromise, name, direction, moving, 1, true, companion, companionTexturePromise);