//#define UIINFO_DEBUG
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;

public class UIGameInfoView : UIBaseView {

    [SerializeField]
    private Text difficultyText;

    [SerializeField]
    private Text mapSizeText;

    [SerializeField]
    private Text zombieCountText;

    public UnityAction OnInfoClosed;

    public void ShowInfo(CurrentGameData gameData) {
        this.ShowView();

        this.difficultyText.text = gameData.Difficulty < 0.25f ? "Easy" : gameData.Difficulty < 0.5f ? "Medium" : gameData.Difficulty < 0.8f ? "Hard" : "Hardcore";
        this.mapSizeText.text = string.Format("{0}x{0}", gameData.MapSize);
        this.zombieCountText.text = gameData.Zombies.ToString();
    }
        
    public void OnInfoConfirmed () {
#if UIINFO_DEBUG
        Debug.Log("[UIInfo] Confirm Info");
#endif

        if (OnInfoClosed != null) {
            OnInfoClosed.Invoke();
        }
    }
}
