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

[CreateAssetMenu(fileName = "New TurnSystem", menuName = "ScriptableObjects/TurnSystem")]
public class TurnSystem :  ScriptableObject
{
    private int turnNumber = 1;
    public event EventHandler OnTurnChanged;
    private bool isPlayerTurn = true;

    public void OnEnable()
    {
        turnNumber = 1;
        isPlayerTurn = true;
    }

    public void EndTurn() {
        turnNumber++;
        isPlayerTurn = !isPlayerTurn;
        OnTurnChanged?.Invoke(this, EventArgs.Empty);
    }
    public int GetTurnNumber() => turnNumber;   
    public bool IsPlayerTurn() => isPlayerTurn;
}