Beispiel #1
0
 public int FindScoreOfMostValuableHand(Tile winningDiscardedTile)
 {
     FindMostValuableWayToParseWinningHand(winningDiscardedTile);
     if (BestWayToParseHand == null)
     {
         return(0);
     }
     return(HandScorer.ScoreHand(BestWayToParseHand));
 }
Beispiel #2
0
 public int FindScoreOfMostValuableHand()
 {
     FindMostValuableWayToParseWinningHand();
     if (BestWayToParseHand == null)
     {
         return(0);
     }
     return(HandScorer.ScoreHand(BestWayToParseHand));
 }
Beispiel #3
0
        private void CheckAndUpdateBestWayToParseWinningHand(IList <IList <TileGrouping> > allWaysToParseWinningHand)
        {
            var maxScore = 0;

            foreach (var wayToParse in allWaysToParseWinningHand)
            {
                var tilesPlusCombinedSetsAndBonus = wayToParse.Concat(CalledSets).Concat(BonusSets).ToList();
                var newScore = HandScorer.ScoreHand(tilesPlusCombinedSetsAndBonus);
                if (newScore >= maxScore)
                {
                    maxScore           = newScore;
                    BestWayToParseHand = tilesPlusCombinedSetsAndBonus;
                }
            }
        }