"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFeatures = void 0;
const CustomGridEntities_1 = require("./classes/features/callbackLogic/CustomGridEntities");
const CustomRevive_1 = require("./classes/features/callbackLogic/CustomRevive");
const EsauJrDetection_1 = require("./classes/features/callbackLogic/EsauJrDetection");
const FlipDetection_1 = require("./classes/features/callbackLogic/FlipDetection");
const GameReorderedCallbacks_1 = require("./classes/features/callbackLogic/GameReorderedCallbacks");
const GridEntityCollisionDetection_1 = require("./classes/features/callbackLogic/GridEntityCollisionDetection");
const GridEntityRenderDetection_1 = require("./classes/features/callbackLogic/GridEntityRenderDetection");
const GridEntityUpdateDetection_1 = require("./classes/features/callbackLogic/GridEntityUpdateDetection");
const ItemPickupDetection_1 = require("./classes/features/callbackLogic/ItemPickupDetection");
const PickupChangeDetection_1 = require("./classes/features/callbackLogic/PickupChangeDetection");
const PlayerCollectibleDetection_1 = require("./classes/features/callbackLogic/PlayerCollectibleDetection");
const PlayerReorderedCallbacks_1 = require("./classes/features/callbackLogic/PlayerReorderedCallbacks");
const SlotDestroyedDetection_1 = require("./classes/features/callbackLogic/SlotDestroyedDetection");
const SlotRenderDetection_1 = require("./classes/features/callbackLogic/SlotRenderDetection");
const SlotUpdateDetection_1 = require("./classes/features/callbackLogic/SlotUpdateDetection");
const CharacterHealthConversion_1 = require("./classes/features/other/CharacterHealthConversion");
const CharacterStats_1 = require("./classes/features/other/CharacterStats");
const CollectibleItemPoolType_1 = require("./classes/features/other/CollectibleItemPoolType");
const CustomHotkeys_1 = require("./classes/features/other/CustomHotkeys");
const CustomItemPools_1 = require("./classes/features/other/CustomItemPools");
const CustomPickups_1 = require("./classes/features/other/CustomPickups");
const CustomStages_1 = require("./classes/features/other/CustomStages");
const CustomTrapdoors_1 = require("./classes/features/other/CustomTrapdoors");
const DebugDisplay_1 = require("./classes/features/other/DebugDisplay");
const DeployJSONRoom_1 = require("./classes/features/other/DeployJSONRoom");
const DisableAllSound_1 = require("./classes/features/other/DisableAllSound");
const DisableInputs_1 = require("./classes/features/other/DisableInputs");
const EdenStartingStatsHealth_1 = require("./classes/features/other/EdenStartingStatsHealth");
const ExtraConsoleCommands_1 = require("./classes/features/other/ExtraConsoleCommands");
const FadeInRemover_1 = require("./classes/features/other/FadeInRemover");
const FastReset_1 = require("./classes/features/other/FastReset");
const FlyingDetection_1 = require("./classes/features/other/FlyingDetection");
const ForgottenSwitch_1 = require("./classes/features/other/ForgottenSwitch");
const ItemPoolDetection_1 = require("./classes/features/other/ItemPoolDetection");
const ModdedElementDetection_1 = require("./classes/features/other/ModdedElementDetection");
const ModdedElementSets_1 = require("./classes/features/other/ModdedElementSets");
const NoSirenSteal_1 = require("./classes/features/other/NoSirenSteal");
const Pause_1 = require("./classes/features/other/Pause");
const PersistentEntities_1 = require("./classes/features/other/PersistentEntities");
const PickupIndexCreation_1 = require("./classes/features/other/PickupIndexCreation");
const PlayerCollectibleTracking_1 = require("./classes/features/other/PlayerCollectibleTracking");
const PonyDetection_1 = require("./classes/features/other/PonyDetection");
const PressInput_1 = require("./classes/features/other/PressInput");
const PreventChildEntities_1 = require("./classes/features/other/PreventChildEntities");
const PreventGridEntityRespawn_1 = require("./classes/features/other/PreventGridEntityRespawn");
const RerunDetection_1 = require("./classes/features/other/RerunDetection");
const RoomClearFrame_1 = require("./classes/features/other/RoomClearFrame");
const RoomHistory_1 = require("./classes/features/other/RoomHistory");
const RunInNFrames_1 = require("./classes/features/other/RunInNFrames");
const RunNextRoom_1 = require("./classes/features/other/RunNextRoom");
const RunNextRun_1 = require("./classes/features/other/RunNextRun");
const SaveDataManager_1 = require("./classes/features/other/SaveDataManager");
const SpawnRockAltRewards_1 = require("./classes/features/other/SpawnRockAltRewards");
const StageHistory_1 = require("./classes/features/other/StageHistory");
const StartAmbush_1 = require("./classes/features/other/StartAmbush");
const TaintedLazarusPlayers_1 = require("./classes/features/other/TaintedLazarusPlayers");
const UnlockAchievementsDetection_1 = require("./classes/features/other/UnlockAchievementsDetection");
const ISCFeature_1 = require("./enums/ISCFeature");
const ModCallbackCustom_1 = require("./enums/ModCallbackCustom");
const enums_1 = require("./functions/enums");
(0, enums_1.validateInterfaceMatchesEnum)();
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
function getFeatures(mod, callbacks) {
    // Some features rely on other features; we must initialize those first.
    const gameReorderedCallbacks = new GameReorderedCallbacks_1.GameReorderedCallbacks(callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_GAME_STARTED_REORDERED], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_NEW_LEVEL_REORDERED], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_NEW_ROOM_REORDERED], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_GAME_STARTED_REORDERED_LAST]);
    const disableAllSound = new DisableAllSound_1.DisableAllSound();
    const disableInputs = new DisableInputs_1.DisableInputs();
    const moddedElementDetection = new ModdedElementDetection_1.ModdedElementDetection();
    const ponyDetection = new PonyDetection_1.PonyDetection();
    const pressInput = new PressInput_1.PressInput();
    const roomClearFrame = new RoomClearFrame_1.RoomClearFrame();
    const roomHistory = new RoomHistory_1.RoomHistory();
    const runNextRoom = new RunNextRoom_1.RunNextRoom();
    const saveDataManager = new SaveDataManager_1.SaveDataManager(mod);
    const stageHistory = new StageHistory_1.StageHistory();
    const runInNFrames = new RunInNFrames_1.RunInNFrames(roomHistory);
    const pickupIndexCreation = new PickupIndexCreation_1.PickupIndexCreation(roomHistory, saveDataManager);
    const customGridEntities = new CustomGridEntities_1.CustomGridEntities(runInNFrames);
    const moddedElementSets = new ModdedElementSets_1.ModdedElementSets(moddedElementDetection);
    const itemPoolDetection = new ItemPoolDetection_1.ItemPoolDetection(moddedElementSets);
    const pause = new Pause_1.Pause(disableInputs);
    const preventGridEntityRespawn = new PreventGridEntityRespawn_1.PreventGridEntityRespawn(runInNFrames);
    const customTrapdoors = new CustomTrapdoors_1.CustomTrapdoors(customGridEntities, disableInputs, ponyDetection, roomClearFrame, runInNFrames, runNextRoom, stageHistory);
    const features = {
        // Callback logic
        [ISCFeature_1.ISCFeature.CUSTOM_REVIVE]: new CustomRevive_1.CustomRevive(callbacks[ModCallbackCustom_1.ModCallbackCustom.PRE_CUSTOM_REVIVE], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_CUSTOM_REVIVE], runInNFrames),
        [ISCFeature_1.ISCFeature.ESAU_JR_DETECTION]: new EsauJrDetection_1.EsauJrDetection(callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_ESAU_JR], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_FIRST_ESAU_JR]),
        [ISCFeature_1.ISCFeature.FLIP_DETECTION]: new FlipDetection_1.FlipDetection(callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_FLIP], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_FIRST_FLIP]),
        [ISCFeature_1.ISCFeature.GRID_ENTITY_COLLISION_DETECTION]: new GridEntityCollisionDetection_1.GridEntityCollisionDetection(callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_GRID_ENTITY_COLLISION], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_COLLISION], customGridEntities),
        [ISCFeature_1.ISCFeature.GRID_ENTITY_UPDATE_DETECTION]: new GridEntityUpdateDetection_1.GridEntityUpdateDetection(callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_GRID_ENTITY_INIT], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_INIT], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_GRID_ENTITY_UPDATE], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_UPDATE], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_GRID_ENTITY_REMOVE], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_REMOVE], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_GRID_ENTITY_STATE_CHANGED], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_STATE_CHANGED], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_GRID_ENTITY_BROKEN], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_BROKEN], customGridEntities),
        [ISCFeature_1.ISCFeature.GRID_ENTITY_RENDER_DETECTION]: new GridEntityRenderDetection_1.GridEntityRenderDetection(callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_GRID_ENTITY_RENDER], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_GRID_ENTITY_CUSTOM_RENDER], customGridEntities),
        [ISCFeature_1.ISCFeature.GAME_REORDERED_CALLBACKS]: gameReorderedCallbacks,
        [ISCFeature_1.ISCFeature.ITEM_PICKUP_DETECTION]: new ItemPickupDetection_1.ItemPickupDetection(callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_ITEM_PICKUP], callbacks[ModCallbackCustom_1.ModCallbackCustom.PRE_ITEM_PICKUP]),
        [ISCFeature_1.ISCFeature.PICKUP_CHANGE_DETECTION]: new PickupChangeDetection_1.PickupChangeDetection(callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_PICKUP_CHANGED], pickupIndexCreation),
        [ISCFeature_1.ISCFeature.PLAYER_COLLECTIBLE_DETECTION]: new PlayerCollectibleDetection_1.PlayerCollectibleDetection(callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_PLAYER_COLLECTIBLE_ADDED], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_PLAYER_COLLECTIBLE_REMOVED], moddedElementSets, runInNFrames),
        [ISCFeature_1.ISCFeature.PLAYER_REORDERED_CALLBACKS]: new PlayerReorderedCallbacks_1.PlayerReorderedCallbacks(callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_PEFFECT_UPDATE_REORDERED], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_PLAYER_RENDER_REORDERED], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_PLAYER_UPDATE_REORDERED]),
        [ISCFeature_1.ISCFeature.SLOT_DESTROYED_DETECTION]: new SlotDestroyedDetection_1.SlotDestroyedDetection(callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_SLOT_DESTROYED], roomHistory),
        [ISCFeature_1.ISCFeature.SLOT_RENDER_DETECTION]: new SlotRenderDetection_1.SlotRenderDetection(callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_SLOT_RENDER], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_SLOT_ANIMATION_CHANGED]),
        [ISCFeature_1.ISCFeature.SLOT_UPDATE_DETECTION]: new SlotUpdateDetection_1.SlotUpdateDetection(callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_SLOT_INIT], callbacks[ModCallbackCustom_1.ModCallbackCustom.POST_SLOT_UPDATE]),
        // Extra features
        [ISCFeature_1.ISCFeature.CHARACTER_HEALTH_CONVERSION]: new CharacterHealthConversion_1.CharacterHealthConversion(),
        [ISCFeature_1.ISCFeature.CHARACTER_STATS]: new CharacterStats_1.CharacterStats(),
        [ISCFeature_1.ISCFeature.COLLECTIBLE_ITEM_POOL_TYPE]: new CollectibleItemPoolType_1.CollectibleItemPoolType(pickupIndexCreation),
        [ISCFeature_1.ISCFeature.CUSTOM_GRID_ENTITIES]: customGridEntities,
        [ISCFeature_1.ISCFeature.CUSTOM_ITEM_POOLS]: new CustomItemPools_1.CustomItemPools(),
        [ISCFeature_1.ISCFeature.CUSTOM_HOTKEYS]: new CustomHotkeys_1.CustomHotkeys(),
        [ISCFeature_1.ISCFeature.CUSTOM_PICKUPS]: new CustomPickups_1.CustomPickups(),
        [ISCFeature_1.ISCFeature.CUSTOM_STAGES]: new CustomStages_1.CustomStages(customGridEntities, customTrapdoors, disableAllSound, gameReorderedCallbacks, pause, runInNFrames),
        [ISCFeature_1.ISCFeature.CUSTOM_TRAPDOORS]: customTrapdoors,
        [ISCFeature_1.ISCFeature.DEBUG_DISPLAY]: new DebugDisplay_1.DebugDisplay(mod),
        [ISCFeature_1.ISCFeature.DEPLOY_JSON_ROOM]: new DeployJSONRoom_1.DeployJSONRoom(preventGridEntityRespawn),
        [ISCFeature_1.ISCFeature.DISABLE_ALL_SOUND]: disableAllSound,
        [ISCFeature_1.ISCFeature.DISABLE_INPUTS]: disableInputs,
        [ISCFeature_1.ISCFeature.EDEN_STARTING_STATS_HEALTH]: new EdenStartingStatsHealth_1.EdenStartingStatsHealth(),
        [ISCFeature_1.ISCFeature.FADE_IN_REMOVER]: new FadeInRemover_1.FadeInRemover(),
        [ISCFeature_1.ISCFeature.FAST_RESET]: new FastReset_1.FastReset(),
        [ISCFeature_1.ISCFeature.FLYING_DETECTION]: new FlyingDetection_1.FlyingDetection(moddedElementSets),
        [ISCFeature_1.ISCFeature.FORGOTTEN_SWITCH]: new ForgottenSwitch_1.ForgottenSwitch(pressInput),
        [ISCFeature_1.ISCFeature.EXTRA_CONSOLE_COMMANDS]: new ExtraConsoleCommands_1.ExtraConsoleCommands(),
        [ISCFeature_1.ISCFeature.ITEM_POOL_DETECTION]: itemPoolDetection,
        [ISCFeature_1.ISCFeature.MODDED_ELEMENT_DETECTION]: moddedElementDetection,
        [ISCFeature_1.ISCFeature.MODDED_ELEMENT_SETS]: moddedElementSets,
        [ISCFeature_1.ISCFeature.NO_SIREN_STEAL]: new NoSirenSteal_1.NoSirenSteal(),
        [ISCFeature_1.ISCFeature.PAUSE]: pause,
        [ISCFeature_1.ISCFeature.PERSISTENT_ENTITIES]: new PersistentEntities_1.PersistentEntities(roomHistory),
        [ISCFeature_1.ISCFeature.PICKUP_INDEX_CREATION]: pickupIndexCreation,
        [ISCFeature_1.ISCFeature.PLAYER_COLLECTIBLE_TRACKING]: new PlayerCollectibleTracking_1.PlayerCollectibleTracking(),
        [ISCFeature_1.ISCFeature.PONY_DETECTION]: ponyDetection,
        [ISCFeature_1.ISCFeature.PRESS_INPUT]: pressInput,
        [ISCFeature_1.ISCFeature.PREVENT_CHILD_ENTITIES]: new PreventChildEntities_1.PreventChildEntities(),
        [ISCFeature_1.ISCFeature.PREVENT_GRID_ENTITY_RESPAWN]: preventGridEntityRespawn,
        [ISCFeature_1.ISCFeature.RERUN_DETECTION]: new RerunDetection_1.RerunDetection(),
        [ISCFeature_1.ISCFeature.ROOM_CLEAR_FRAME]: roomClearFrame,
        [ISCFeature_1.ISCFeature.ROOM_HISTORY]: roomHistory,
        [ISCFeature_1.ISCFeature.RUN_IN_N_FRAMES]: runInNFrames,
        [ISCFeature_1.ISCFeature.RUN_NEXT_ROOM]: runNextRoom,
        [ISCFeature_1.ISCFeature.RUN_NEXT_RUN]: new RunNextRun_1.RunNextRun(),
        [ISCFeature_1.ISCFeature.SAVE_DATA_MANAGER]: saveDataManager,
        [ISCFeature_1.ISCFeature.SPAWN_ALT_ROCK_REWARDS]: new SpawnRockAltRewards_1.SpawnRockAltRewards(itemPoolDetection),
        [ISCFeature_1.ISCFeature.STAGE_HISTORY]: stageHistory,
        [ISCFeature_1.ISCFeature.START_AMBUSH]: new StartAmbush_1.StartAmbush(runInNFrames),
        [ISCFeature_1.ISCFeature.TAINTED_LAZARUS_PLAYERS]: new TaintedLazarusPlayers_1.TaintedLazarusPlayers(),
        [ISCFeature_1.ISCFeature.UNLOCK_ACHIEVEMENTS_DETECTION]: new UnlockAchievementsDetection_1.UnlockAchievementsDetection(),
    };
    return features;
}
exports.getFeatures = getFeatures;
