First commit for private source control. Older commits available on Github.
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using BriarQueen.Framework.Coordinators.Events;
|
||||
using BriarQueen.Framework.Managers.Player;
|
||||
using BriarQueen.Framework.Managers.Player.Data;
|
||||
using Cysharp.Threading.Tasks;
|
||||
|
||||
namespace BriarQueen.Framework.Managers.Interaction.Data
|
||||
{
|
||||
/// <summary>
|
||||
/// Inventory-safe per-item logic. Serialized INSIDE ItemDataSo via SerializeReference.
|
||||
/// No scene objects required.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public abstract class BaseInteraction
|
||||
{
|
||||
/// <summary>
|
||||
/// Called when player uses 'self' on 'other' from the inventory UI.
|
||||
/// Return true if the interaction was handled (success OR "can't" message shown).
|
||||
/// Return false if this interaction doesn't apply, so caller may try other routes/fallback.
|
||||
/// </summary>
|
||||
public abstract UniTask<bool> TryUseWith(
|
||||
ItemDataSo self,
|
||||
ItemDataSo other,
|
||||
PlayerManager playerManager,
|
||||
EventCoordinator eventCoordinator);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Default "does nothing" interaction.
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public sealed class NoOpItemInteraction : BaseInteraction
|
||||
{
|
||||
public override UniTask<bool> TryUseWith(
|
||||
ItemDataSo self,
|
||||
ItemDataSo other,
|
||||
PlayerManager playerManager,
|
||||
EventCoordinator eventCoordinator)
|
||||
{
|
||||
return UniTask.FromResult(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user