Ejemplo n.º 1
0
 private void initReperes()
 {
     if (RepereType.getTypeForCurrentGame() == RepereType.TypeEnum.Couleur)
     {
         initReperesWithRandomColors();
     }
     else
     {
         initReperesWithRandomPointCardinal();
     }
 }
Ejemplo n.º 2
0
 private void checkDiceReperes()
 {
     if (RepereType.getTypeForCurrentGame() == RepereType.TypeEnum.Couleur)
     {
         if ((targetRepere1 != null) && targetRepere1.hasRegularValue())
         {
             onDiceRepereDone();
         }
     }
     else
     {
         if ((targetRepere2 != null) && targetRepere2.hasRegularValue())
         {
             onDiceRepereDone();
         }
     }
 }
Ejemplo n.º 3
0
    private void launchDiceReperes()
    {
        int  repereRandomIndex = Random.Range(0, RepereType.NB_TYPE_TOUS);
        bool repereRegulier    = repereRandomIndex < RepereType.NB_TYPE_REGULIER;

        targetRepere1 = repereRegulier ? ReperesManager.Instance.getRepereTypeWithIndex(repereRandomIndex) : null;

        if (RepereType.getTypeForCurrentGame() == RepereType.TypeEnum.Couleur)
        {
            targetRepere1IsTreasure = false;
            RepereType.TypeCouleur repereType;
            Color repereColor;

            if (repereRegulier)
            {
                repereType  = targetRepere1.typeCouleur;
                repereColor = targetRepere1.getTypeCouleurValue();
            }
            else
            {
                repereType  = (RepereType.TypeCouleur)repereRandomIndex;
                repereColor = RepereType.getTypeCouleurValue(repereType);
            }

            DicesManager.Instance.setDiceColorForRepere(repereType, repereColor);
        }
        else
        {
            RepereType.TypePointCardinal repereType1;
            RepereType.TypePointCardinal repereType2;
            string repereInfo1;
            string repereInfo2;

            if (repereRegulier)
            {
                repereType1             = targetRepere1.typePointCardinal;
                repereInfo1             = targetRepere1.getTypePointCardinalValue(true);
                targetRepere1IsTreasure = false;
            }
            else
            {
                repereType1             = (RepereType.TypePointCardinal)repereRandomIndex;
                repereInfo1             = RepereType.getTypePointCardinalValue(repereType1, true);
                targetRepere1IsTreasure = repereType1 == RepereType.TypePointCardinal.Special;
            }

            repereRandomIndex = Random.Range(0, RepereType.NB_TYPE_TOUS);
            repereRegulier    = repereRandomIndex < RepereType.NB_TYPE_REGULIER;

            if (repereRegulier)
            {
                targetRepere2 = ReperesManager.Instance.getRepereTypeWithIndex(repereRandomIndex);
                repereType2   = targetRepere2.typePointCardinal;
                repereInfo2   = targetRepere2.getTypePointCardinalValue(false);
            }
            else
            {
                repereType2 = (RepereType.TypePointCardinal)repereRandomIndex;
                repereInfo2 = RepereType.getTypePointCardinalValue(repereType2, false);
            }

            DicesManager.Instance.setDiceCardinalForReperes(repereType1, repereType2, repereInfo1, repereInfo2);
        }

        checkDiceReperes();
    }