2025-08-08 06:44:11 +00:00
|
|
|
using System;
|
2025-08-14 04:46:36 +00:00
|
|
|
using System.Collections.Generic;
|
2025-07-17 08:55:45 +00:00
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace DDD
|
|
|
|
{
|
2025-08-08 06:44:11 +00:00
|
|
|
[Flags]
|
|
|
|
public enum InteractionType : uint
|
2025-07-17 08:55:45 +00:00
|
|
|
{
|
2025-08-08 06:44:11 +00:00
|
|
|
None = 0u,
|
|
|
|
RestaurantManagementUi = 1u << 0,
|
|
|
|
OpenRestaurant = 1u << 1,
|
|
|
|
All = 0xFFFFFFFFu
|
2025-07-17 08:55:45 +00:00
|
|
|
}
|
2025-08-08 06:44:11 +00:00
|
|
|
|
2025-07-17 08:55:45 +00:00
|
|
|
public interface IInteractable
|
|
|
|
{
|
|
|
|
bool CanInteract();
|
2025-08-14 04:46:36 +00:00
|
|
|
bool OnInteracted(IInteractor interactor, ScriptableObject payloadSo = null);
|
2025-07-22 11:15:20 +00:00
|
|
|
InteractionType GetInteractionType();
|
|
|
|
GameObject GetInteractableGameObject();
|
|
|
|
void InitializeInteraction(InteractionType interactionType);
|
2025-08-05 08:09:14 +00:00
|
|
|
float GetRequiredHoldTime();
|
2025-08-05 10:46:36 +00:00
|
|
|
string GetInteractionMessageKey();
|
2025-07-17 08:55:45 +00:00
|
|
|
}
|
2025-08-14 04:46:36 +00:00
|
|
|
|
2025-07-17 08:55:45 +00:00
|
|
|
public interface IInteractor
|
|
|
|
{
|
2025-07-22 11:15:20 +00:00
|
|
|
GameObject GetInteractorGameObject();
|
2025-08-14 04:46:36 +00:00
|
|
|
IInteractable GetFocusedInteractable();
|
|
|
|
bool CanSolveInteractionType(InteractionType interactionType);
|
|
|
|
bool CanInteractTo(IInteractable interactable,
|
|
|
|
ScriptableObject payloadSo = null);
|
2025-07-22 11:15:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public interface IInteractionSolver
|
|
|
|
{
|
2025-08-14 04:46:36 +00:00
|
|
|
bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject payloadSo = null);
|
|
|
|
bool CanExecuteInteraction(IInteractor interactor = null, IInteractable interactable = null,
|
|
|
|
ScriptableObject payloadSo = null);
|
2025-07-17 08:55:45 +00:00
|
|
|
}
|
|
|
|
}
|