/** * UFOSystem - Intelligent Wandering UFO Easter Egg * * A rare visitor that browses the night sky with curiosity and purpose. * Features: * - Wandering behavior with pauses and direction changes * - Intelligent tractor beam that scans stars, tracks celestial events, or observes ground * - State machine controlling behavior transitions * * Rendering and mood management delegated to: * - IUFORenderer - hull, dome, shield, beam, lights * - IUFOParticleRenderer - narrative effects, particles * - IUFOMoodManager - emotional state, wobble animations */ import type { AccessibilitySettings, Dimensions, QualityLevel } from "../../../core/domain/types.js"; import type { ICosmicCalculationService } from "./contracts/ICosmicCalculationService.js"; import type { IUFORenderer } from "./contracts/IUFORenderer.js"; import type { IUFOParticleRenderer } from "./contracts/IUFOParticleRenderer.js"; import type { IUFOMoodManager } from "./contracts/IUFOMoodManager.js"; import type { IUFOStarScanner } from "./contracts/IUFOStarScanner.js"; import type { IUFOInteractionHandler } from "./contracts/IUFOInteractionHandler.js"; import type { IUFOBehaviorRunner } from "./contracts/IUFOBehaviorRunner.js"; import type { IUFOEntranceAnimator } from "./contracts/IUFOEntranceAnimator.js"; import type { IUFOExitAnimator } from "./contracts/IUFOExitAnimator.js"; import type { IUFOMovementController } from "./contracts/IUFOMovementController.js"; import type { IUFODecisionMaker } from "./contracts/IUFODecisionMaker.js"; import type { UFOConfig, UFOState, UFOMood, UFOEntranceType, UFOExitType, WobbleType, StarInfo, EventPosition } from "./domain/ufo-types.js"; export type { UFOConfig, UFOMood, UFOEntranceType, UFOExitType, WobbleType } from "./domain/ufo-types.js"; export declare class UFOSystem { private ufo; private timer; private config; private calculationService; private quality; private dimensions; private renderer; private particleRenderer; private moodManager; private starScanner; private interactionHandler; private behaviorRunner; private entranceAnimator; private exitAnimator; private movementController; private decisionMaker; private ufoFactory; private stateCallbacks; private behaviorCallbacks; private starProvider; private eventProvider; constructor(config: UFOConfig, calculationService: ICosmicCalculationService, renderer: IUFORenderer, particleRenderer: IUFOParticleRenderer, moodManager: IUFOMoodManager, starScanner: IUFOStarScanner, interactionHandler: IUFOInteractionHandler, behaviorRunner: IUFOBehaviorRunner, entranceAnimator: IUFOEntranceAnimator, exitAnimator: IUFOExitAnimator, movementController: IUFOMovementController, decisionMaker: IUFODecisionMaker); /** * Set provider for nearby stars (for beam targeting) */ setStarProvider(provider: () => StarInfo[]): void; /** * Set provider for active celestial events (meteor/comet position) */ setEventProvider(provider: () => EventPosition | null): void; /** * Create behavior context for behavior runner */ private createBehaviorContext; update(dim: Dimensions, a11y: AccessibilitySettings, quality: QualityLevel): void; /** All entrance types for random selection */ private readonly entranceTypes; /** All exit types for random selection */ private readonly exitTypes; private spawnUFO; private updateUFO; /** * Trigger a wobble animation (public for testing via UFO Lab) */ triggerWobble(type: WobbleType): void; private updateEntering; private updateWandering; /** Calculate shortest angle difference - delegated to movement controller */ private angleDiff; private updatePaused; private updateScanning; private updateExiting; private startPause; private decideAfterPause; private startTrackingEvent; private startChasing; private updateChasing; private startGivingUp; private updateGivingUp; private endScanning; /** * UFO arrived at the location user clicked - scan it! */ private arriveAtClickTarget; private resumeWandering; private startExiting; private findNearbyBrightStar; private rememberScannedStar; private findStarNearPosition; draw(ctx: CanvasRenderingContext2D, a11y: AccessibilitySettings): void; /** * Manually trigger UFO to appear * @param dim - Screen dimensions * @param entranceType - Optional specific entrance animation * @param exitType - Optional specific exit animation (saved for when UFO leaves) */ trigger(dim: Dimensions, entranceType?: UFOEntranceType, exitType?: UFOExitType): void; /** * Trigger UFO with a specific entrance type */ triggerWithEntrance(dim: Dimensions, entranceType: UFOEntranceType): void; /** * Check if UFO is currently visible */ isActive(): boolean; /** * Get UFO position for external systems */ getPosition(): { x: number; y: number; } | null; /** * Get current UFO state for UI display */ getState(): UFOState | null; /** * Get current UFO mood for external systems */ getMood(): UFOMood | null; /** * Set UFO mood externally (for click interactions, events, etc.) */ setMood(mood: UFOMood): void; /** * Get UFO tiredness level (0-1) */ getTiredness(): number | null; /** * Reset UFO tiredness to 0 (for testing) */ resetTiredness(): void; /** * Get count of scanned stars in UFO's memory */ getScannedStarsCount(): number; /** * Clear UFO's memory of scanned stars */ clearScannedStars(): void; /** * Get UFO heading in radians */ getHeading(): number | null; private updateCollectingSample; private startCollectingSample; private updatePhotographing; private startPhotographing; private updateInvestigatingGround; private startInvestigatingGround; private updatePanicking; private startPanicking; private updateSurfing; private startSurfing; private updateCommunicating; private startCommunicating; private updateNapping; private startNapping; private updatePeekaboo; private startHiding; private updateCelebrating; private startCelebrating; private updateFollowing; private startFollowing; /** * Handle a click on the canvas - UFO reacts based on distance and mood * @param clickX - Click X position in canvas coordinates * @param clickY - Click Y position in canvas coordinates * @returns true if UFO reacted to the click */ handleClick(clickX: number, clickY: number): boolean; private handleDirectHit; private handleNearMiss; private handleFarClick; /** * Command UFO to scan a nearby star */ commandScanStar(): boolean; /** * Command UFO to scan the ground below */ commandScanGround(): void; /** * Command UFO to pause and chill */ commandPause(): void; /** * Command UFO to wander around */ commandWander(): void; /** * Command UFO to drift lazily */ commandDrift(): void; /** * Command UFO to leave with its preset exit type */ commandExit(): void; /** * Command UFO to leave with a specific exit animation */ commandExitWith(exitType: UFOExitType): void; /** * Get current entrance/exit types for UI display */ getEntranceExitTypes(): { entrance: UFOEntranceType; exit: UFOExitType; } | null; /** * Get all available entrance types */ getAvailableEntranceTypes(): UFOEntranceType[]; /** * Get all available exit types */ getAvailableExitTypes(): UFOExitType[]; cleanup(): void; } //# sourceMappingURL=UFOSystem.d.ts.map