public Case HighestCase(AllCamels camels) { Case result = new Case(); int totalVisite = 0; foreach (var caseVisited in casesVisited) { totalVisite += caseVisited.Value; if (camels.CanPutTrap(caseVisited.Key) && caseVisited.Value >= result.nbVisite) { result.pos = caseVisited.Key; result.nbVisite = caseVisited.Value; } } result.equity = (float)result.nbVisite / (totalVisite / camels.GetUnrollCamelsCount()); return result; }
AllRankCount MoveWithAllDicesCombo(AllCamels allCamels, AllRankCount ranks) { List<List<int>> dices = DicesCombinationsPossible(allCamels.GetUnrollCamelsCount()); Dictionary<string, string> dicesAndRank = new Dictionary<string, string>(); foreach (List<int> d in dices) { AllCamels tempCamels = new AllCamels(allCamels); tempCamels.MoveCamels(d, ranks); ranks.UpdateRankCount (tempCamels.SortCamelInOrderPos()); dicesAndRank.Add(DicesToString(d), tempCamels.ShortInfoCamel()); } logRank.Add(allCamels.OrderForDiceInfoCamel(), dicesAndRank); return ranks; }