import type { FishMarineLife } from "../../domain/models/OceanModels.js"; import type { IFishHuntingHandler, ActiveHunt, HuntResult, HuntState, HuntStats } from "../contracts/IFishHuntingHandler.js"; import type { IFishWobbleAnimator } from "../contracts/IFishWobbleAnimator.js"; /** * FishHuntingHandler - Manages predator/prey chase sequences * * Creates emergent drama through pursuit and escape: * - Sleek fish are active predators (fast, bold, solitary) * - Deep fish are ambush predators (patient, z-axis approach) * - Tropical/schooling fish are prey (flee, school up) * * No death mechanics - just pursuit behavior that adds life to the scene. */ export declare class FishHuntingHandler implements IFishHuntingHandler { private activeHunts; private stats; private wobbleAnimator; constructor(wobbleAnimator?: IFishWobbleAnimator); processHunting(fish: FishMarineLife[], deltaSeconds: number, animationTime: number, dimensions?: { width: number; height: number; }): HuntResult[]; applyHuntResult(result: HuntResult, fish: FishMarineLife[]): void; isPredator(fish: FishMarineLife): boolean; isPrey(fish: FishMarineLife): boolean; getActiveHunts(): ActiveHunt[]; getStats(): HuntStats; forceHunt(predator: FishMarineLife, prey: FishMarineLife, animationTime: number): void; cancelAllHunts(): void; getHuntVisualization(fish: FishMarineLife): { targetX: number; targetY: number; state: HuntState; } | null; private canHunt; private findPrey; private startHunt; private clearHuntState; /** Return a predator to normal cruising. Safe to call on a half-cancelled hunt. */ private clearPredatorHuntState; /** Return prey to normal cruising. Safe to call on a half-cancelled hunt. */ private clearPreyHuntState; private applyStalking; private applyChasing; private applyFleeing; /** * Prey wins the close-quarters exchange: explosive dart re-opens the gap. * Routed through the normal darting behavior so the C-start coil/burst/ * recovery phases and speed easing all apply. */ private applyEscapeJuke; /** * Moves a fish along a unit heading at `speed` px/s. * * baseSpeed is px/s, so displacement is speed * dt — no frame factor. (An * older version multiplied by an extra 60, launching hunts at ~60x intended * speed: predators teleport-dashed and locked chase pairs oscillated around * each other at thousands of px/s.) * * Writes baseY alongside y so the cruising formula (y = baseY + bob) picks * up where the hunt left off instead of snapping back to the pre-hunt * vertical position when the hunt ends. * * Direction flips are gated two ways, because `direction` is a hard ±1 that * the renderer mirrors instantly (ctx.scale(-direction, 1)) — every write is a * visible snap, not an eased turn: * * 1. `heading.x` must clear a deadzone, so a near-vertical chase doesn't * flip facing on horizontal noise. * 2. `partnerDistance` must exceed FLIP_SUPPRESS_DISTANCE. A deadzone on * heading.x alone does NOT cover the actual failure: once predator and prey * overlap, the steering target is a sub-pixel offset whose NORMALIZED * heading is ≈±1 and alternates sign every frame. That sailed through the * 0.15 gate and produced the observed left/right buzz — measured 3562 of * 3643 flips landing within one second of the same fish's previous flip, * median gap 0.017s (one frame), essentially all of them in chasing / * fleeing / stalking. */ private moveAlongHeading; private alertSchoolmates; private distance; private randomInRange; } //# sourceMappingURL=FishHuntingHandler.d.ts.map