//C'est la que la magie arrive ei: calculer les odds public void CestLaQueLaPoutineSePasse () { gameCamels = new AllCamels (initialCamels); gameCamels.ShortInfoCamel(); if (isBugged) gameCamels.InfoCamel("GameCamel First"); List<AllCamels> allPermutations = gameCamels.AllUnrollCamelsPermutation(); foreach (var permu in allPermutations) { if(isBugged) permu.InfoCamel("Permuration de camels",permu.OrderedCamelsForDice); rankCounts = MoveWithAllDicesCombo (permu, rankCounts); } //rankCounts.InfoRankCount (); //WriteInfoInFile("Result",LogRankToInfo(initialCamels.InfoCamel(), DicesCombinationsPossible(initialCamels.GetUnrollCamelsCount()))); }
public void MoveCamels(List<int> dices, AllRankCount ranks) { string info = string.Empty; if(dices.Count != GetUnrollCamelsCount()) { Debug.LogError (string.Format ("Il y a {0} camels Unroll et {1} dés", GetUnrollCamelsCount (), dices.Count)); return; } int diceIndex = 0; for (int i = 0; i < orderedCamelsForDice.Count; i++) { if (!orderedCamelsForDice[i].isDiceRoll) { MoveCamel(orderedCamelsForDice[i].name, dices[diceIndex]); diceIndex++; ranks.UpdateCasesVisited(orderedCamelsForDice[i].pos); } } }
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; }