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

[System.Serializable]
public struct LevelLimits
{
    [SerializeField] float leftLimit;
    [SerializeField] float rightLimit;
    [SerializeField] float upLimit;

    public float LeftLimit { get => leftLimit; }
    public float RightLimit { get => rightLimit; }
    public float UpLimit { get => upLimit; }
}

public class GameManager : MonoBehaviour
{
    public static GameManager Instance { get; private set; }
    [SerializeField, Header("Tick time in seconds")] private float tickTime = 1;

    [SerializeField, Space (10)] LevelLimits levelLimits;

    [SerializeField] PlayerSO[] playerStats;
    [SerializeField] int medicineClickAmount = 100;
    [SerializeField] int resourceMaxAmount = 20;

    public float TickTime { get => tickTime; set => tickTime = value; }
    public LevelLimits LevelLimits { get => levelLimits; set => levelLimits = value; }
    public PlayerSO[] PlayerStats { get => playerStats; }
    public int MedicineClickAmount { get => medicineClickAmount; }
    public int ResourceMaxAmount { get => resourceMaxAmount; }

    private void Awake()
    {
        if (Instance == null)
            Instance = this;
        else if (Instance != this)
            Destroy(gameObject);
        DontDestroyOnLoad(gameObject);
    }
}
