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

namespace UI.Notification
{
    public class NotificationManager : MonoBehaviour
    {
        [SerializeField] Transform notificationContainer;
        [SerializeField] GameObject offerComplitedNotification;
        [SerializeField] GameObject salaryNotification;

        [SerializeField] float notificationLiveTime = 5;

        public void SendOfferCompletedNotification(Offer offer)
        {
            var notification = Instantiate(offerComplitedNotification, notificationContainer).GetComponent<OfferCompletedNotification>();
            notification.SetInformation(offer);
            Destroy(notification.gameObject, notificationLiveTime);

            Sound.SoundController.Instance.Play(SoundType.Notification);
        }

        public void SendSalaryNotification(int salary)
        {
            var notification = Instantiate(salaryNotification, notificationContainer).GetComponent<SalaryNotification>();
            notification.SetInformation(salary);
            Destroy(notification.gameObject, notificationLiveTime);

            Sound.SoundController.Instance.Play(SoundType.Notification);
        }
    }
}