/**
 * Decoupled Game Engine for BaoLife
 *
 * Provides a testable game loop that handles core game logic.
 * Extracted from initLifeSim() for CLI use and testing.
 */
import { Player, Person, Season } from '../../models/index.js';
export interface IGameStorage {
    saveGame(player: Player): Promise<void>;
    loadGame(playerId: string): Promise<Player | null>;
}
export interface IGameOutput {
    sendEventMessage(event: GameEvent): Promise<void>;
    sendUserInfo(player: Player): Promise<void>;
    sendDict(data: Record<string, unknown>): Promise<void>;
}
export interface GameEvent {
    type: 'messageEvent' | 'questionEvent';
    id: string;
    message: string;
    [key: string]: unknown;
}
export interface BatchedUpdate {
    type?: string;
    date?: string;
    hourOfDay?: number;
    minuteOfHour?: number;
    weekDayText?: string;
    energy?: number;
    calcEnergy?: number;
    money?: number;
    diamonds?: number;
    prestige?: number;
    stress?: number;
    happiness?: number;
    occupation?: string;
    location?: string;
    schedules?: unknown[];
    intraDayMessage?: string;
    dailyPlan?: unknown[];
    gameSpeed?: number;
    [key: string]: unknown;
}
/**
 * Decoupled game engine that can run with or without WebSocket
 */
export declare class GameEngine {
    private storage;
    private output;
    constructor(storage?: IGameStorage, output?: IGameOutput);
    /**
     * Get the season based on month
     */
    getSeason(month: number): Season;
    /**
     * Calculate death chance based on age and health.
     * Delegates to health_manager for the full Python-compatible implementation.
     *
     * Death probabilities increase with age and are divided by health:
     * - Age 20-30: 0.000001 / health
     * - Age 30-40: 0.000002 / health
     * - Age 40-50: 0.000003 / health
     * - Age 50-60: 0.000004 / health
     * - Age 60-70: 0.000005 / health
     * - Age 70-82: 0.000006 / health (noticeable increase)
     * - Age 82-100: 0.0002 / health (significant increase)
     * - Age 100+: 0.0012 / health (high probability)
     */
    updateDeathChance(person: Person): number;
    /**
     * Check if a person should die based on their death chance.
     * Delegates to health_manager.
     *
     * @param person - Person to check
     * @returns true if the person should die, false otherwise
     */
    checkDeath(person: Person): boolean;
    /**
     * Get peak energy for a person
     * Calculates based on habits, activities, education, and job level (matches Python)
     * Also updates person.peakEnergy and person.calcEnergy
     *
     * Energy costs include:
     * - Quitting habits: +5 each
     * - Extracurricular activities: energyModifier from catalog (10-40)
     * - Education (schools): energyModifier from school (15-20)
     * - Jobs: level.energy_modifier
     * - Focus modifiers: Work Hard +10, Slack Off -10, Socialize +10, Balanced 0
     */
    getPeakEnergy(person: Person): number;
    /**
     * Update age tracking for a day and handle relationship decay
     * Ported from Python stats_manager.py updateAge()
     *
     * Decay mechanics:
     * - Every 30 days (for player > 18 years): affinity -= 1 for all relationships
     * - On relationship birthday (yearly): affinity -= 1 + death chance update
     * - Affinity floor at -100
     */
    updateAge(player: Player): GameEvent | null;
    /**
     * Handle player character death.
     * Sets status to dead, controller to inactive, and queues death message.
     * Delegates to health_manager for the core logic.
     */
    handleDeath(player: Player): void;
    /**
     * Run one game tick for a player
     */
    runGameTick(player: Player, forceUpdate?: boolean): Promise<Player>;
    /**
     * Handle weekly updates for a person
     * Public so LoopManager can call it for all relationships
     *
     * Matches Python's weekly tick processing in loop_manager.py:
     * - handleFinances
     * - handleMoods
     * - handleEducation
     * - handleJob
     * - handleRelationships
     * - handleHabitChanges (for player character only)
     */
    handleWeeklyUpdates(player: Player, person: Person): void;
    /**
     * Process habit quitting progress for a person
     * Called weekly to increment quit progress for habits with status 'quitting'
     * After 30 weeks, the habit is successfully quit and removed
     *
     * Matches Python handleHabitChanges() from health/health_manager.py
     */
    handleHabitChanges(player: Player, person: Person): void;
    /**
     * Handle weekly finances for a person
     */
    private handleFinances;
    /**
     * Handle weekly mood updates for a person
     */
    private handleMoods;
    /**
     * Handle weekly education updates
     * Uses education_manager for proper GPA updates based on focus level
     *
     * Focus effects on GPA:
     * - Work Hard: GPA increases more often (+1 modifier)
     * - Slack Off: GPA decreases more often (-1 modifier)
     * - Balanced/Socialize: Neutral changes
     */
    private handleEducation;
    /**
     * Handle weekly job updates
     */
    private handleJob;
    /**
     * Handle weekly relationship updates
     * Ported from Python: handleRelationships in functions.py and relationship_manager.py
     *
     * Weekly decay mechanics:
     * - Familiarity decays by 1 per week (toward 0)
     * - Affinity decays by 1 per week (toward 0, not below 0 for weekly)
     * - 5% chance of random relationship events for romantic relationships
     * - Messaging modifiers decay toward neutral (handled separately)
     *
     * Note: The main affinity decay (monthly and yearly) is handled in updateAge()
     */
    private handleRelationships;
    /**
     * Synchronous wrapper for runGameTick (for testing)
     */
    runGameTickSync(player: Player, forceUpdate?: boolean): Player;
}
export declare function getGameEngine(): GameEngine;
export declare function setGameEngine(storage?: IGameStorage, output?: IGameOutput): GameEngine;
//# sourceMappingURL=GameEngine.d.ts.map