public int FindScoreOfMostValuableHand(Tile winningDiscardedTile) { FindMostValuableWayToParseWinningHand(winningDiscardedTile); if (BestWayToParseHand == null) { return(0); } return(HandScorer.ScoreHand(BestWayToParseHand)); }
public int FindScoreOfMostValuableHand() { FindMostValuableWayToParseWinningHand(); if (BestWayToParseHand == null) { return(0); } return(HandScorer.ScoreHand(BestWayToParseHand)); }
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; } } }