Ejemplo n.º 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);
    }
Ejemplo n.º 2
0
        public override bool Interact(HandInteraction getHandInteractionState, IHands hands)
        {
            _isOpen = !_isOpen;

            _animator.SetBool(isOpen, _isOpen);

            return(true);
        }
Ejemplo n.º 3
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);
     }
 }
Ejemplo n.º 4
0
 public void BuryCards(IHumanPlayer player, List <SheepCard> cards, bool goItAlone, SheepCard?partnerCard)
 {
     if (TurnType != TurnType.Bury)
     {
         throw new WrongGamePhaseExcpetion("Game must be in the Bury phase.");
     }
     if (PartnerMethodEnum == Models.PartnerMethod.JackOfDiamonds || !partnerCard.HasValue)
     {
         new PickProcessor().BuryCards(IHands.Last(), player, cards, goItAlone);
     }
     else
     {
         new PickProcessor().BuryCards(IHands.Last(), player, cards, goItAlone, partnerCard.Value);
     }
 }
Ejemplo n.º 5
0
        public List <GameCoins> GameCoins()
        {
            var coins = IHands
                        .Select(d => d.CalculateScores()?.Coins)
                        .Where(c => c != null)
                        .ToList();

            return(Players
                   .Select(p => new GameCoins()
            {
                Name = p.Name,
                Coins = coins.Sum(c => c[p])
            })
                   .ToList());
        }
Ejemplo n.º 6
0
    void Start()
    {
        hands = GetComponent <IHands>();
        debug = GetComponent <LiveDebug>();

        var predictor    = new DataBasedAlphabeticPredictor(EnglishWords.AsList());
        var layerCreator = new LetterBasedLayerCreator(letters, predictor);

        knobArranger = new KnobArranger(letters, knobs, layerCreator, new ConsistentAlphabeticLogicalLettersPlacer());
        knobArranger.Arrange(0f);

        var gestures = new Gestures(knobs);

        gesturesStrategy = new GesturesStrategy(gestures, knobArranger, debug);

        hands.OnHandUpdate      += OnHandUpdate;
        gesturesStrategy.OnWord += wordSuggester.Suggest;
    }
Ejemplo n.º 7
0
    public override bool Interact(HandInteraction getHandInteractionState, IHands hands)
    {
        if (_isOpen && _content.Count > 0)
        {
            var pickup = _content[0];
            _content.RemoveAt(0);

            var contentInstance = Instantiate(pickup, transform);

            PickUp(getHandInteractionState, hands, contentInstance);
        }
        else
        {
            _isOpen = !_isOpen;
        }

        _animator.SetBool(isOpen, _isOpen);

        return(true);
    }
Ejemplo n.º 8
0
 public virtual bool Interact(HandInteraction getHandInteractionState, IHands hands)
 {
     return(false);
 }
Ejemplo n.º 9
0
 public Human(IHands hands)
 {
     this.hands = hands;
 }
Ejemplo n.º 10
0
 public Brain(IHands hands)
 {
     this.hands = hands;
     rand = new Random();
 }
Ejemplo n.º 11
0
 public CPU(int number, IHands hands)
 {
     this.number = number;
     this.hands = hands;
 }
Ejemplo n.º 12
0
 public Brain(IHands hands)
 {
     this.hands = hands;
     rand       = new Random();
 }