﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(fileName = "New Action", menuName = "Scriptable Objects/Actions/Action")]
public class Action : ScriptableObjectBase
{
	public string text;
	public string nextScene;
	public string nextSceneUI;

	public float length;
	public List<StatisticEffect> statisticEffects;
	public List<string> responses;

	public delegate void PerformAction(Action sender);
	public static event PerformAction OnPerformed;

	public override ScriptableObjectBase Clone()
	{
		Action clone = base.Clone() as Action;
		clone.length = length;
		clone.statisticEffects = statisticEffects;

		return clone;
	}

	public override void CopyTo(ref ScriptableObjectBase scriptableObjectBase)
	{
		base.CopyTo(ref scriptableObjectBase);

		(scriptableObjectBase as Action).length = length;
		(scriptableObjectBase as Action).statisticEffects = statisticEffects;
	}

	public void Perform()
	{
		OnPerformed(this);
	}
}

[System.Serializable]
public struct StatisticEffect
{
	public StatisticType statisticType;
	public float value;
}