示例#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);
    }
示例#2
0
        public override bool Interact(HandInteraction getHandInteractionState, IHands hands)
        {
            _isOpen = !_isOpen;

            _animator.SetBool(isOpen, _isOpen);

            return(true);
        }
示例#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);
     }
 }
示例#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);
     }
 }
示例#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());
        }
示例#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;
    }
示例#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);
    }
示例#8
0
 public virtual bool Interact(HandInteraction getHandInteractionState, IHands hands)
 {
     return(false);
 }
示例#9
0
 public Human(IHands hands)
 {
     this.hands = hands;
 }
示例#10
0
 public Brain(IHands hands)
 {
     this.hands = hands;
     rand = new Random();
 }
示例#11
0
文件: CPU.cs 项目: Sweetwater/RPSGame
 public CPU(int number, IHands hands)
 {
     this.number = number;
     this.hands = hands;
 }
示例#12
0
 public Brain(IHands hands)
 {
     this.hands = hands;
     rand       = new Random();
 }