import type { Observable } from "rxjs"; import { Subject } from "rxjs"; import type { AddPlayerEvent } from "../../Events/AddPlayerEvent"; import type { PlayerPosition } from "../../Events/PlayerPosition"; import { ActionsMenuAction } from "../ui"; import type { PublicPlayerState, ReadOnlyPublicPlayerState } from "../PublicPlayerState"; export interface RemotePlayerInterface { /** * A unique ID for this player. Each character on the map has a unique ID */ readonly playerId: number; /** * The displayed name for this player */ readonly name: string; /** * A unique ID for the user. Unlike the "id", 2 characters can have the same UUID if they belong to the same user * (i.e. if the same user logged twice using 2 different tabs) */ readonly uuid: string; /** * The color of the outline around the player's name */ readonly outlineColor: number | undefined; /** * The position of the current player, expressed in game pixels, relative to the top - left of the map. */ readonly position: PlayerPosition; /** * A stream updated with the position of this current player. */ readonly position$: Observable; /** * An object storing players variables */ readonly state: ReadOnlyPublicPlayerState; /** * Send an event to the player. * Remote player can listen to this event using `WA.event.on(key).subscribe((event) => { ... })`. */ sendEvent(key: string, value: unknown): Promise; } export declare class RemotePlayer implements RemotePlayerInterface { private _playerId; private _name; private _userUuid; private _availabilityStatus; private _outlineColor; private _position; private _variables; private _variablesSubjects; readonly state: ReadOnlyPublicPlayerState; private actions; constructor(addPlayerEvent: AddPlayerEvent); get playerId(): number; get name(): string; get uuid(): string; /** * Todo */ get outlineColor(): number | undefined; get position(): PlayerPosition; set position(_position: PlayerPosition); readonly _position$: Subject<{ x: number; y: number; }>; readonly position$: Observable<{ x: number; y: number; }>; destroy(): void; setVariable(name: K, value: PublicPlayerState[K]): void; addAction(key: string, callback: () => void): ActionsMenuAction; callAction(key: string): void; removeAction(key: string): void; sendEvent(name: string, data: unknown): Promise; } export interface RemotePlayerMoved { player: RemotePlayerInterface; newPosition: PlayerPosition; oldPosition: PlayerPosition; }