import { RpgPlayer } from '../Player/Player'; import { RpgMap } from './map'; export declare const ARRIVAL_GRACE_MS = 1000; export type PhysicsCollisionEntity = { uuid: string; owner?: any; position?: { x: number; y: number; }; width?: number; height?: number; }; /** * Tracks physical contacts between players and events on a map and dispatches * `onTouch`, `onTouchEnd` and `onPlayerTouch` event hooks. * * A contact is tracked from collision enter to collision exit. It becomes * active (and dispatches `start`) only while both entities are on the same * touchable z and ground sensors cover enough of the other entity. */ export declare class MapTouchCollisions { private readonly map; private activeTouchCollisions; private trackedTouchCollisions; private arrivalContacts; private arrivals; constructor(map: RpgMap); clear(): void; /** * Silences the events a player overlaps when it joins the map (a door placed * on the arrival point of another door) until the player leaves them. */ suppressArrivalContacts(player: RpgPlayer): void; private readBooleanSignal; private isGroundTouchSensorEntity; haveDifferentTouchableZ(entityA: PhysicsCollisionEntity, entityB: PhysicsCollisionEntity): boolean; private buildTouchPairId; private getPhysicsRect; private getSensorCoverage; private hasEnoughGroundSensorCoverage; private dispatchTouch; private dispatchTouchCollision; private canActivateTouchCollision; private isArriving; private updateTrackedTouchCollision; refreshTrackedTouchCollisions(): void; trackTouchCollision(entityA: PhysicsCollisionEntity, entityB: PhysicsCollisionEntity): void; untrackTouchCollision(entityA: PhysicsCollisionEntity, entityB: PhysicsCollisionEntity, options?: { dispatchEnd?: boolean; }): void; }