using UnityEngine;

namespace Assets.Scripts.NohaMorte
{
    public class UserActionMechanics : UserAgentBaseClass
    {

        [SerializeField]
        MovementOnSphereMechanic movementOnSphereMechanic;
        [SerializeField]
        LineRenderer lineRenderer;

        public void CollisionResponse(Transform other)
        {
            movementOnSphereMechanic.canMove = false;
            lineRenderer.positionCount = 0;
            lineRenderer.SetPositions(new Vector3[] { this.transform.position, other.position });
        }



        private void OnEnable()
        {
            buttonPad.diagonalButtonsDownMechanic_GreenWhite_12.AddListener(DiagonalButtonsPressed_White_Debug);
            buttonPad.diagonalButtonsDownMechanic_RedYellow_03.AddListener(DiagonalButtonsPressed_Red_Debug);
            buttonPad.allButtonsDownMechanic.AddListener(AllButtonsDebug);
        }

        public void OnDisable()
        {
            buttonPad.diagonalButtonsDownMechanic_GreenWhite_12.RemoveListener(DiagonalButtonsPressed_White_Debug);
            buttonPad.diagonalButtonsDownMechanic_RedYellow_03.RemoveListener(DiagonalButtonsPressed_Red_Debug);
            buttonPad.allButtonsDownMechanic.RemoveListener(AllButtonsDebug);
        }

        public void AllButtonsDebug()
        {
            Debug.Log("All buttons pressed by agent " + userAgentManager.seatIndex);
        }
        public void DiagonalButtonsPressed_Red_Debug()
        {
            Debug.Log("DiagonalButtons_Red_Green pressed by agent " + userAgentManager.seatIndex);
        }
        public void DiagonalButtonsPressed_White_Debug()
        {
            Debug.Log("DiagonalButtons_White_Yellow pressed by agent " + userAgentManager.seatIndex);
        }



    }
}



