refactor: restructure interaction system into clean layers
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using Game.Features.Items.Contracts;
|
||||
|
||||
namespace Game.Features.Interactions.Application;
|
||||
|
||||
public readonly record struct PickupAvailability(bool LeftHand, bool RightHand, bool RequiresBoth);
|
||||
|
||||
public sealed class ResolvePickupAvailability
|
||||
{
|
||||
public PickupAvailability Resolve(HandRequirement requirement, bool leftHandFree, bool rightHandFree)
|
||||
{
|
||||
if (requirement == HandRequirement.Both)
|
||||
{
|
||||
bool canUseBoth = leftHandFree && rightHandFree;
|
||||
return new PickupAvailability(canUseBoth, canUseBoth, true);
|
||||
}
|
||||
|
||||
return new PickupAvailability(leftHandFree, rightHandFree, false);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user