using System;
using UnityEngine;

namespace pdinklag.CPW.Common
{
    [Serializable]
    public class TwoAlternativesMovesetEntry : MovesetEntry<TwoAlternativesMovesetEntry>
    {
        [Tooltip("The primary move.")]
        public AssetAddress Primary;

        [Tooltip("The alternative move.")]
        public AssetAddress Alternative;

        public override AssetAddress[] Moves => new AssetAddress[] { Primary, Alternative };

        public TwoAlternativesMovesetEntry()
        {
        }

        public TwoAlternativesMovesetEntry(TwoAlternativesMovesetEntry other)
        {
            Primary = other.Primary;
            Alternative = other.Alternative;
        }

        public override void Merge(TwoAlternativesMovesetEntry other)
        {
            Primary = OverrideIfValid(Primary, other.Primary);
            Alternative = OverrideIfValid(Alternative, other.Alternative);
        }
    }
}
