//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 GetRollDiceEquity(string board, string remainingCard) { AllCamels originAllCamels = new AllCamels(board); List<Camel> unRollCamels = originAllCamels.GetUnrollCamels().ToList(); /* UnityEngine.Debug.LogWarning(board); foreach (var unRollCamel in unRollCamels) { for (int dice = 0; dice < GameRules.DICES_FACES; dice++) { AllCamels tempCamels = new AllCamels(board); tempCamels.MoveCamel(unRollCamel.name, dice); StatFactory statFactory =new StatFactory(); statFactory.CreateBoard(board); statFactory.CestLaQueLaPoutineSePasse(); //cashCardManager.PopulateCashCards(cardRemaining); //statFactory.FindEquityCashCard(cashCardManager.GetCashCards()); } }*/ }
public AllCamels(AllCamels originalCamels) { blue = new Camel(originalCamels.blue); white = new Camel(originalCamels.white); orange = new Camel(originalCamels.orange); yellow = new Camel(originalCamels.yellow); green = new Camel(originalCamels.green); camels = new List<Camel>(); camels.Add(blue); camels.Add(white); camels.Add(orange); camels.Add(yellow); camels.Add(green); allTraps = new List<Trap>(originalCamels.allTraps); orderedCamelsForDice = new List<Camel>(); if(originalCamels.orderedCamelsForDice != null) { foreach (var myCamel in originalCamels.orderedCamelsForDice) { orderedCamelsForDice.Add(GetCamel(myCamel.name)); } } for(int i = 0; i < originalCamels.GetCamels().Count; i++) { Camel originalCamel = originalCamels.GetCamel (i); if(originalCamel.camelOnTop != null) { Camel camel = GetCamel(originalCamel.name); camel.camelOnTop = GetCamel(originalCamel.camelOnTop.name); } } }
public List<AllCamels> AllUnrollCamelsPermutation() { List<AllCamels> result = new List<AllCamels>(); foreach (var unrollCamels in FindAllPermutation(GetUnrollCamels().ToList())) { List<Camel> allCamelsForDice = GetRollCamels().ToList(); foreach (var unrollCamel in unrollCamels) allCamelsForDice.Add(unrollCamel); if(allCamelsForDice.Count != 5 ) { Debug.LogError(string.Format("Pas le bon nombre de camel: {0}", allCamelsForDice.Count)); } AllCamels combo = new AllCamels(allCamelsForDice, allTraps); combo.orderedCamelsForDice = allCamelsForDice; result.Add(combo); } return result; }
private void OnAutoMoveUIClick(string camel, int diceNumber) { AllCamels currentCamels = new AllCamels(GetBoard()); currentCamels.MoveCamel(camel, diceNumber, true); UpdateBoard(currentCamels.GetBoard()); }
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; }
public void PopulateInitialCamel(string board) { initialCamels = new AllCamels(board); }