using System; using System.Collections.Generic; using UnityEngine; namespace DDD { [Flags] public enum InteractionType : uint { None = 0u, RestaurantManagement = 1u << 0, RestaurantOrder = 1u << 1, RestaurantMeal = 1u << 2, All = 0xFFFFFFFFu } [System.Serializable] public struct InteractionExecutionParameters { [SerializeField] private float _holdTime; public float HoldTime => _holdTime; public InteractionExecutionParameters(float holdTime = 1f) { _holdTime = holdTime; } } [System.Serializable] public struct InteractionDisplayParameters { [SerializeField] private string _messageKey; public string MessageKey => _messageKey; public InteractionDisplayParameters(string messageKey = "") { _messageKey = messageKey; } } public interface IInteractable { bool CanInteract(); bool IsInteractionHidden(); bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null); InteractionType GetInteractionType(); GameObject GetInteractableGameObject(); void InitializeInteraction(InteractionType interactionType); InteractionExecutionParameters GetExecutionParameters(); InteractionDisplayParameters GetDisplayParameters(); Vector3[] GetInteractionPoints(); } public interface IInteractor { GameObject GetInteractorGameObject(); IInteractable GetFocusedInteractable(); bool CanSolveInteractionType(InteractionType interactionType); bool CanInteractTo(IInteractable interactable, ScriptableObject payloadSo = null); } public interface IInteractionSolver { bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject payloadSo = null); bool CanExecuteInteraction(IInteractor interactor = null, IInteractable interactable = null, ScriptableObject payloadSo = null); } }