using System; using UnityEngine; namespace DDD { public interface IInteractionSubsystemObject where T : Enum { T GetInteractionSubsystemType(); } public interface IInteractionSubsystemSolver where T : Enum { bool ExecuteInteractionSubsystem(IInteractor interactor, IInteractable interactable, ScriptableObject payloadSo = null); bool CanExecuteInteractionSubsystem(IInteractor interactor = null, IInteractable interactable = null, ScriptableObject payloadSo = null); } public interface IInteractionSubsystemSubject where T : Enum { bool CanSolveInteractionType(T interactionSubsystemType); bool CanInteractTo(IInteractionSubsystemObject interactableSubsystemObject, ScriptableObject payloadSo = null); } [Flags] public enum RestaurantOrderInteractionType : uint { // None = 0u, WaitCustomer = 1u << 0, // WaitOrder = 1u << 1, // WaitServe = 1u << 2, // All = 0xFFFFFFFFu } public class RestaurantOrderInteraction : RestaurantInteractionComponent, IInteractionSubsystemObject { [SerializeField] protected RestaurantOrderInteractionType _initialOrderInteractionType = RestaurantOrderInteractionType.WaitCustomer; private RestaurantOrderInteractionType _currentRestaurantOrderInteractionType; // EDITOR private void Reset() { SetInteractionTypeToRestaurantOrder(); } private void OnValidate() { SetInteractionTypeToRestaurantOrder(); } // ~EDITOR private void Start() { } private void SetInteractionTypeToRestaurantOrder() { _interactionType = InteractionType.RestaurantOrder; } InteractionType GetInteractionType() { return InteractionType.RestaurantOrder; } bool CanInteract() { return TODO_IMPLEMENT_ME; } bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null); void InitializeInteraction(InteractionType interactionType); InteractionExecutionParameters GetExecutionParameters(); InteractionDisplayParameters GetDisplayParameters(); public RestaurantOrderInteractionType GetInteractionSubsystemType() { return _currentRestaurantOrderInteractionType; } } }