20 lines
637 B
C#
20 lines
637 B
C#
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);
|
|
}
|
|
}
|