using PkmnLib.Dynamic.Events;
using PkmnLib.Dynamic.Libraries;
using PkmnLib.Dynamic.Models.Choices;
using PkmnLib.Dynamic.ScriptHandling;
namespace PkmnLib.Dynamic.Models;
///
/// A battle is a representation of a battle in the Pokemon games. It contains all the information needed
/// to simulate a battle, and can be used to simulate a battle between two parties.
///
public interface IBattle : IScriptSource
{
///
/// The library the battle uses for handling.
///
IDynamicLibrary Library { get; }
///
/// A list of all different parties in the battle.
///
IReadOnlyList Parties { get; }
///
/// Whether or not Pokemon can flee from the battle.
///
bool CanFlee { get; }
///
/// The number of sides in the battle. Typically 2.
///
byte NumberOfSides { get; }
///
/// The number of Pokemon that can be on each side.
///
byte PositionsPerSide { get; }
///
/// A list of all sides in the battle.
///
IReadOnlyList Sides { get; }
///
/// The RNG used for the battle.
///
IBattleRandom Random { get; }
///
/// Whether the battle has ended.
///
bool HasEnded { get; }
///
/// The result of the battle. If the battle has not ended, this is null.
///
BattleResult? Result { get; }
///
/// The handler to send all events to.
///
EventHook EventHook { get; }
///
/// The index of the current turn. Initially 0, until the first turn starts when all choices are made.
///
uint CurrentTurnNumber { get; }
///
/// A queue of the yet to be executed choices in a turn.
///
BattleChoiceQueue ChoiceQueue { get; }
///
/// Get a Pokemon on the battlefield, on a specific side and an index on that side.
///
IPokemon GetPokemon(byte side, byte position);
///
/// Returns whether a slot on the battlefield can still be filled. If no party is responsible
/// for that slot, or a party is responsible, but has no remaining Pokemon to throw out anymore,
/// this returns false.
///
bool CanSlotBeFilled(byte side, byte position);
///
/// Validates whether the battle is still in a non-ended state. If the battle has ended, this
/// properly sets who has won etc.
///
void ValidateBattleState();
///
/// Checks whether a choice is actually possible.
///
void CanUse(ITurnChoice choice);
///
/// Try and set the choice for the battle. If the choice is not valid, this returns false.
///
bool TrySetChoice(ITurnChoice choice);
///
/// Sets the current weather for the battle. If null is passed, this clears the weather.
///
void SetWeather(string? weatherName);
///
/// Gets the current weather of the battle. If no weather is present, this returns null.
///
string? WeatherName { get; }
}