using System.Collections.Generic;
namespace Cthangover.Mods.Rpg
{
///
/// Something placed on a map cell that reacts to the player, in the spirit of
/// RPG Maker events: an NPC, a sign, a chest, a door. What it looks like and
/// what it does are independent:
///
/// - look — a charset , or one atlas , or nothing (an invisible trigger);
/// - effect — a , handled natively, or a dialog built
/// from a file followed by inline
/// (the full scenario DSL, so action rpg.battle …, flag …, quests).
///
/// A in the scenario condition language hides the
/// event while false; it is re-checked whenever game state changes, so a
/// defeated boss (flag boss_dead 1) disappears at once.
///
public class RpgMapEvent
{
/// Id unique within the map.
public string Id { get; set; }
/// Column.
public int X { get; set; }
/// Row.
public int Y { get; set; }
/// Charset image in the charsets group (3 frames × 4 facings).
public string Sprite { get; set; }
/// Atlas index of the map's tileset drawn as the event when it has no sprite; -1 for none.
public int Tile { get; set; } = -1;
/// Initial facing of a sprite.
public RpgDirection Dir { get; set; } = RpgDirection.Down;
/// When the event fires.
public RpgEventTrigger Trigger { get; set; } = RpgEventTrigger.Action;
/// The event occupies its cell. Null means "solid when it is visible" (a sprite or a tile).
public bool? Solid { get; set; }
/// Scenario path inside the scenarios group (extension optional), played as a dialog.
public string Scenario { get; set; }
/// Inline DSL lines appended after the scenario.
public List Commands { get; set; }
/// Moves the player instead of starting a dialog.
public RpgTeleport Teleport { get; set; }
/// Scenario condition; the event exists only while it is true.
public string Condition { get; set; }
/// Effective solidity: explicit value, else whether the event is drawn.
public bool IsSolid => Solid ?? (!string.IsNullOrEmpty(Sprite) || Tile >= 0);
}
}