using UnityEngine;

namespace pdinklag.CPW.Common
{
    public class ArenaInfo : MonoBehaviour
    {
        public static readonly string TAG = "ArenaInfo";

        [Header("Meta")]
        [Tooltip("The address of the corresponding descriptor.")]
        public AssetAddress DescriptorAddress;

        [Header("Lights")]
        [Tooltip("The arena's main light source.")]
        public Light MainLight;

        [Tooltip("The lights for the curtain and stage area.")]
        public Light[] StageLights;

        [Tooltip("The ring lights.")]
        public Light[] RingLights;

        [Header("Spotlights")]
        [Tooltip("The spotlights in the entrance's curtain area.")]
        public SpotlightPrefab[] SpotlightsCurtain;

        [Tooltip("The spotlights on the stage.")]
        public SpotlightPrefab[] SpotlightsStage;

        [Tooltip("The spotlights on the ceiling.")]
        public SpotlightPrefab[] SpotlightsCeiling;

        [Header("Camera Spots")]
        public CameraSpot CameraRingCenter;
        public float CameraRingsideRadius = 8.0f;
        public CameraSpot CameraStageEast;
        public CameraSpot CameraStageWest;
        public CameraSpot CameraArenaSouthEast;
        public CameraSpot CameraArenaSouthWest;

        [Header("Waypoints")]
        [Tooltip("The position where wrestlers come out from behind the curtain.")]
        public EntranceWaypoint WaypointCurtain;

        [Tooltip("The center of the stage.")]
        public EntranceWaypoint WaypointStageCenter;

        [Tooltip("The middle of the entrance ramp.")]
        public EntranceWaypoint WaypointRampMiddle;

        [Tooltip("The north ringside area, coming from the ramp.")]
        public EntranceWaypoint WaypointRingsideNorth;

        [Tooltip("The place to go for wrestlers who have been eliminated and need to leave the arena.")]
        public EntranceWaypoint WaypointLeaveArena;

        [Header("Curtains")]
        [Tooltip("The curtains to collide against when entering.")]
        public Cloth[] EntranceCurtains;

        [Header("Technical")]
        [Tooltip("When a wrestler exits these bounds for whatever reason, they will be teleported back into the ring.")]
        public Bounds WorldBounds = new(Vector3.zero, new Vector3(100, 100, 100));

#if UNITY_EDITOR
        private void OnDrawGizmosSelected()
        {
            DebugExtension.DrawBounds(WorldBounds, Color.yellow);

            if (CameraRingCenter)
            {
                DebugExtension.DrawCircle(CameraRingCenter.transform.position, Vector3.up, Color.green, CameraRingsideRadius);
            }
        }
#endif
    }
}
