Esempio n. 1
0
    //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())));
    }
Esempio n. 2
0
    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());
            }                    
        }*/
    }
Esempio n. 3
0
	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);
			}				
		}
	}
Esempio n. 4
0
	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;
	}
Esempio n. 5
0
 private void OnAutoMoveUIClick(string camel, int diceNumber)
 {
     AllCamels currentCamels = new AllCamels(GetBoard());
     currentCamels.MoveCamel(camel, diceNumber, true);
     UpdateBoard(currentCamels.GetBoard());
 }
Esempio n. 6
0
    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;
    }
Esempio n. 7
0
	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;
    }
Esempio n. 8
0
 public void PopulateInitialCamel(string board)
 {
     initialCamels = new AllCamels(board);
 }