using System;
using UnityEngine;

namespace Intrepid.Gameplay.Journey
{
    public enum JEndpointKind
    {
        Socket = 0,
        Anchor = 1,
        Lift = 2
    }

    public enum JSocketFace
    {
        North = 0,
        South = 1,
        East = 2,
        West = 3
    }

    public static class JSocketFaceUtils
    {
        private static readonly Vector2 North = new(0, -1);
        private static readonly Vector2 South = new(0, 1);
        private static readonly Vector2 East = new(-1, 0);
        private static readonly Vector2 West = new(1, 0);
        
        public static Vector2 DeploymentDirection(JSocketFace socketFace) => socketFace switch
        {
            JSocketFace.North => North,
            JSocketFace.South => South,
            JSocketFace.East => East,
            JSocketFace.West => West,
            _ => throw new ArgumentOutOfRangeException()
        };
    }
    


    public enum JConnectionDirectionality
    {
        Bidirectional = 0,
        AToB = 1,
        BToA = 2
    }

    [Serializable]
    public struct JWorldTile
    {
        public int x;
        public int y;

        public JWorldTile(int x, int y)
        {
            this.x = x;
            this.y = y;
        }

        public Vector2Int ToVector2Int()
        {
            return new Vector2Int(x, y);
        }
    }
}
