using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace ConfigurableCombo;
/// When to reset the combo sequence back to step 1.
[Serializable]
public enum ComboResetMode
{
/// Reset when the game combo timer expires (default, ~15s).
GameTimer = 0,
/// Never reset from time; always advance through the sequence (cycle after last step).
Never = 1,
/// Reset when the current target changes.
OnTargetChange = 2,
/// Reset after the configured number of seconds of inactivity.
AfterSeconds = 3,
}
///
/// A single user-defined combo: put the first action on your hotbar; pressing it advances through the sequence.
///
[Serializable]
public class UserComboDefinition
{
///
/// Display name for this combo (e.g. "WAR ST Combo").
///
public string Name { get; set; } = "New Combo";
///
/// Ordered list of action IDs. The first action is the one you place on the hotbar; each press advances to the next.
/// Combo resets to the first action when the game combo timer expires or the sequence is broken.
///
public List ActionIds { get; set; } = new();
///
/// Whether this combo is enabled.
///
public bool Enabled { get; set; } = true;
///
/// ClassJob.RowId this combo belongs to. 0 = Unspecified (shown when "Unspecified" job is selected).
///
public uint JobId { get; set; }
///
/// Unique id for this combo (for UI and serialization).
///
public Guid Id { get; set; } = Guid.NewGuid();
///
/// The action ID that is "on the bar" — i.e. the trigger. This is ActionIds[0] when the list is non-empty.
///
public uint TriggerActionId => ActionIds.Count > 0 ? ActionIds[0] : 0;
///
/// When to reset this combo to step 1. Per-combo; e.g. one combo can use "Never" while another uses "After seconds".
///
public ComboResetMode ResetMode { get; set; } = ComboResetMode.GameTimer;
///
/// Seconds after which the combo resets when is .
/// Ignored for other modes.
///
public float ResetAfterSeconds { get; set; } = 15f;
///
/// When true (default): using another combo or any action never clears this combo's position; it only resets per its own "Reset when" setting.
/// When false (original): using an action that is not part of this combo clears this combo's state back to step 1.
///
public bool PreservePositionWhenUsingOtherActions { get; set; } = true;
}