コード例 #1
0
 protected void Pick(Card card)
 {
     if (card.Pair == CurrentPair)
     {
         if (UnsolvedPairs.Count == 0)
             Observer?.OnWon();
         else
         {
             ActivateNext();
             Observer?.OnMove(mistake: false);
         }
     }
     else Observer?.OnMove(mistake: true);
 }
コード例 #2
0
ファイル: CardPairGame.cs プロジェクト: nano-byte/NanoPlay
        protected virtual bool HandlePreviousSelection(Card card)
        {
            // Remove previous selection
            if (card != null) card.State = DefaultCardState;

            return true;
        }
コード例 #3
0
ファイル: MemoryGame.cs プロジェクト: nano-byte/NanoPlay
 protected override bool HandlePreviousSelection(Card card)
 {
     // Do not allow selection changes
     return (card == null);
 }