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

public class EventTile : MonoBehaviour {

	#region variables
	[SerializeField]
	private GameTime _interactTime;

	protected DialogueManager _dialogueManager;
	protected EventManager _eventManager;

	[SerializeField]
	private bool _hasDialogue = true;
	#endregion


	#region getters and setters
	public GameTime InteractTime {
		get {
			return _interactTime;
		}
	}
	#endregion


	#region events
	void Awake () {

		_dialogueManager = GameObject.FindObjectOfType <DialogueManager> ();
		
	}
	#endregion


	#region methods
	public virtual void Activate () {

		if (_interactTime == GameManager.CurrentGameTime || _interactTime == GameTime.None) {
			if (_hasDialogue) _dialogueManager.Play ();
			_eventManager.Next ();
		}

	}

	public void SetEventManager (EventManager em) {

		_eventManager = em;
		
	}
	#endregion
	
}
