using System.Collections.Generic;

namespace Wizard;

public class AIPlayReanimate : AIScriptArgumentExpressions
{
	private AIPolishConvertedExpression _reanimateCostArg;

	private AIPolishConvertedExpression _reanimateCountArg;

	private const int REANIMATE_COST_INDEX = 0;

	private const int REANIMATE_COUNT_INDEX = 1;

	public AIPlayReanimate(string text)
		: base(text)
	{
	}

	protected override void InitExpressions(string text)
	{
		base.InitExpressions(text);
		if (_exprList.Count > 1)
		{
			_reanimateCostArg = _exprList[0];
			_reanimateCountArg = _exprList[1];
		}
	}

	public int GetReanimateCost(AIVirtualCard tagOwner, List<int> playPtn)
	{
		if (_reanimateCostArg == null)
		{
			return -1;
		}
		return (int)_reanimateCostArg.EvalArg(tagOwner, playPtn, tagOwner.SelfField);
	}

	public int GetReanimateCount(AIVirtualCard tagOwner, List<int> playPtn)
	{
		if (_reanimateCountArg == null)
		{
			return 0;
		}
		return (int)_reanimateCountArg.EvalArg(tagOwner, playPtn, tagOwner.SelfField);
	}
}
