示例#1
0
        public int PointsPlayed(int player, DeckRegularDict <DutchBlitzCardInformation> otherList)
        {
            int output = 0;

            PileList.ForEach(thisPile =>
            {
                var tempList = thisPile.ObjectList.ToRegularDeckDict();
                output      += tempList.Count(items => items.Player == player);
            });
            output += otherList.Count(items => items.Player == player);
            return(output);
        }
示例#2
0
 public bool HasValidSet(DeckRegularDict <TileInfo> thisCol, out int firstNumber, out int secondNumber)
 {
     firstNumber  = -1;
     secondNumber = -1; //until proven.
     if (thisCol.Count < 3)
     {
         return(false);
     }
     if (thisCol.Count(items => items.IsJoker == true) > 1)
     {
         return(false); //can only use one joker for each set.
     }
     if (thisCol.Count > 2)
     {
         var newCol = thisCol.ToRegularDeckDict();
         if (_rummys !.IsNewRummy(newCol, newCol.Count, RummyProcesses <EnumColorType, EnumColorType, TileInfo> .EnumRummyType.Runs))
         {
             firstNumber  = _rummys.FirstUsed;
             secondNumber = _rummys.FirstUsed + thisCol.Count - 1;
             return(true);
         }
     }
     return(IsKinds(thisCol));
 }