using NaughtyAttributes;
using UnityEngine;

public class SafeZone : MonoBehaviour {
	[field: SerializeField] [field: Required]
	public SafeZoneStats Stats { get; private set; }

	[SerializeField] CircleCollider2D moatCollider;
	[SerializeField] GameObject globalCamera;

	public bool IsInSafeZone { get; private set; } = true;

	void Start() {
        globalCamera.SetActive(true);
	}

	public void EnterSafeZone() {
		IsInSafeZone = true;
		globalCamera.SetActive(true);
	}

	public void ExitSafeZone() {
		IsInSafeZone = false;
        globalCamera.SetActive(false);
	}

	public Vector3 GetOutsidePosition(Vector2 direction) {
		return transform.position + (moatCollider.radius + Stats.JumpOffset) * (Vector3)direction;
	}
}