Example #1
0
    public override bool Interact(HandInteraction getHandInteractionState, IHands hands)
    {
        switch (getHandInteractionState)
        {
        case HandInteraction.NoHands:
            return(false);

        case HandInteraction.Left:
            if (_hands < 2)
            {
                hands.GrabWithLeftHand(this);
            }
            break;

        case HandInteraction.Right:
            if (_hands < 2)
            {
                hands.GrabWithRightHand(this);
            }
            break;

        case HandInteraction.Both:
            hands.GrabWithBothHands(this);
            break;

        default:
            throw new ArgumentOutOfRangeException(nameof(getHandInteractionState), getHandInteractionState, null);
        }

        return(true);
    }
Example #2
0
 private void PickUp(HandInteraction getHandInteractionState, IHands hands, Pickup pickup)
 {
     if (getHandInteractionState == HandInteraction.Left)
     {
         hands.GrabWithLeftHand(pickup);
     }
     if (getHandInteractionState == HandInteraction.Right || getHandInteractionState == HandInteraction.Both)
     {
         hands.GrabWithRightHand(pickup);
     }
 }