2025-08-20 05:07:33 +00:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace DDD
|
|
|
|
{
|
|
|
|
public class RestaurantOrderSolver : MonoBehaviour, IInteractionSolver, IInteractionSubsystemSolver<RestaurantOrderInteractionType>
|
|
|
|
{
|
|
|
|
public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject payloadSo = null)
|
|
|
|
{
|
|
|
|
return ExecuteInteractionSubsystem(interactor, interactable, payloadSo);
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool CanExecuteInteraction(IInteractor interactor = null, IInteractable interactable = null,
|
|
|
|
ScriptableObject payloadSo = null)
|
|
|
|
{
|
|
|
|
return CanExecuteInteractionSubsystem(interactor, interactable, payloadSo);
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool ExecuteInteractionSubsystem(IInteractor interactor, IInteractable interactable, ScriptableObject payloadSo = null)
|
|
|
|
{
|
2025-08-20 06:30:08 +00:00
|
|
|
if (interactable is IInteractionSubsystemObject<RestaurantOrderInteractionType> subsystem)
|
|
|
|
{
|
|
|
|
RestaurantOrderInteractionType interactionType = subsystem.GetInteractionSubsystemType();
|
|
|
|
// Can I solve this interaction type?
|
|
|
|
if (interactionType == RestaurantOrderInteractionType.WaitCustomer)
|
|
|
|
{
|
|
|
|
// DO SOMETHING!!!
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
2025-08-20 05:07:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public bool CanExecuteInteractionSubsystem(IInteractor interactor = null, IInteractable interactable = null,
|
|
|
|
ScriptableObject payloadSo = null)
|
|
|
|
{
|
|
|
|
if (interactable is IInteractionSubsystemObject<RestaurantOrderInteractionType> subsystem)
|
|
|
|
{
|
|
|
|
RestaurantOrderInteractionType interactionType = subsystem.GetInteractionSubsystemType();
|
|
|
|
// Can I solve this interaction type?
|
2025-08-20 06:30:08 +00:00
|
|
|
if (interactionType == RestaurantOrderInteractionType.WaitCustomer)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
2025-08-20 05:07:33 +00:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|