76 lines
2.5 KiB
C#
76 lines
2.5 KiB
C#
using System;
|
|
using UnityEngine;
|
|
|
|
namespace DDD
|
|
{
|
|
public interface IInteractionSubsystemObject<T> where T : Enum
|
|
{
|
|
T GetInteractionSubsystemType();
|
|
}
|
|
public interface IInteractionSubsystemSolver<T> 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<T> where T : Enum
|
|
{
|
|
bool CanSolveInteractionType(T interactionSubsystemType);
|
|
bool CanInteractTo(IInteractionSubsystemObject<T> 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<RestaurantOrderInteractionType>
|
|
{
|
|
[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;
|
|
}
|
|
}
|
|
} |