import { pokemonUtils } from "../utils/pokemonUtils.js";
import { slotDataManager } from "../utils/slotDataManager.js";
// Exemplo de como usar o novo sistema de slots
export function exemploUsoSlots(player) {
    // 1. Capturar um Pokémon (automaticamente adiciona ao primeiro slot disponível)
    const capturado = pokemonUtils.capturePokemon(player, "pr:bulbassaur", 5);
    if (capturado) {
        player.onScreenDisplay.setActionBar("Pokémon capturado!");
    }
    else {
        player.onScreenDisplay.setActionBar("Seus slots estão cheios!");
    }
    // 2. Verificar dados de um slot específico
    const pokemonSlot0 = pokemonUtils.getPokemonFromSlot(player, 0);
    if (pokemonSlot0) {
        console.log(`Pokémon no slot 0: ${pokemonSlot0.namePokemon}, Level: ${pokemonSlot0.level}, HP: ${pokemonSlot0.health}`);
    }
    // 3. Curar um Pokémon
    pokemonUtils.healPokemon(player, 0);
    // 4. Dar XP a um Pokémon
    pokemonUtils.gainExperience(player, 0, 50);
    // 5. Criar dados manualmente e definir em um slot
    const dadosPokemonCustom = {
        health: 100,
        level: 25,
        xp: 450,
        namePokemon: "pr:charmander",
        move1: "pr:ember",
        move2: "pr:scratch",
        move3: "pr:growl",
        move4: "pr:smokescreen"
    };
    slotDataManager.setPokemonSlotData(player, 1, dadosPokemonCustom);
    // 6. Ver todos os slots
    const todosSlots = pokemonUtils.getSlotsPokemon(player);
    todosSlots.forEach((slot, index) => {
        if (slot) {
            console.log(`Slot ${index}: ${slot.namePokemon} (Lv.${slot.level})`);
        }
        else {
            console.log(`Slot ${index}: Vazio`);
        }
    });
    // 7. Debug - ver o tamanho dos dados codificados
    if (pokemonSlot0) {
        slotDataManager.debugSlotSize(pokemonSlot0);
    }
}
// Função para mostrar estatísticas detalhadas de um Pokémon
export function mostrarEstatisticasPokemon(player, slotIndex) {
    const pokemon = pokemonUtils.getPokemonFromSlot(player, slotIndex);
    if (!pokemon) {
        player.onScreenDisplay.setActionBar("Slot vazio!");
        return;
    }
    const info = [
        `§6${pokemon.namePokemon}§r`,
        `§aLevel: ${pokemon.level}§r`,
        `§cHP: ${pokemon.health}§r`,
        `§bXP: ${pokemon.xp}§r`,
        `§eMoves:§r`,
        `  1. ${pokemon.move1}`,
        `  2. ${pokemon.move2}`,
        `  3. ${pokemon.move3}`,
        `  4. ${pokemon.move4}`
    ];
    player.onScreenDisplay.setActionBar(info.join('\n'));
}
// Função para trocar Pokémons entre slots
export function trocarPokemonsSlots(player, slot1, slot2) {
    const pokemon1 = pokemonUtils.getPokemonFromSlot(player, slot1);
    const pokemon2 = pokemonUtils.getPokemonFromSlot(player, slot2);
    if (!pokemon1 && !pokemon2) {
        player.onScreenDisplay.setActionBar("Ambos os slots estão vazios!");
        return;
    }
    // Trocar os Pokémons
    if (pokemon1) {
        slotDataManager.setPokemonSlotData(player, slot2, pokemon1);
    }
    else {
        slotDataManager.clearPokemonSlot(player, slot2);
    }
    if (pokemon2) {
        slotDataManager.setPokemonSlotData(player, slot1, pokemon2);
    }
    else {
        slotDataManager.clearPokemonSlot(player, slot1);
    }
    player.onScreenDisplay.setActionBar(`Pokémons dos slots ${slot1} e ${slot2} trocados!`);
}
