Example #1
0
 public static BasicDiceSide CreateDiceSide(int val, DiceTypes dieType)
 {
     BasicDiceSide retVal;
     switch (dieType)
     {
         case DiceTypes.TypeA:
             retVal = new TypeADiceSide(val);
             break;
         case DiceTypes.TypeB:
             retVal = new TypeBDiceSide(val);
             break;
         case DiceTypes.TypeC:
             retVal = new TypeCDiceSide(val);
             break;
         case DiceTypes.TypeD:
             retVal = new TypeDDiceSide(val);
             break;
         case DiceTypes.TypeE:
             retVal = new TypeEDiceSide(val);
             break;
         default:
             retVal = null;
             break;
     }
     return retVal;
 }
Example #2
0
        public static int[] GetDiceTypeCompersionStatisics(DiceTypes firstType, DiceTypes secondType)
        {
            int[] retVal = new int[3]{0, 0, 0};

            Dice firstDice = new Dice();
            firstDice.Init(firstType);
            Dice secondDice = new Dice();
            secondDice.Init(secondType);

            for (int i = 0; i < 6; i++ )
            {
                BasicDiceSide sideFromFirstDice = firstDice.GetDiceRoll(i);
                for (int j = 0; j < 6; j++)
                {
                    BasicDiceSide sideFromSecondDice = secondDice.GetDiceRoll(j);
                    int fightResult = sideFromFirstDice.InteractWithOtherDice(sideFromSecondDice);
                    retVal[fightResult + 1]++;
                }
            }
            return retVal;
        }
Example #3
0
        public void Init(DiceTypes diceType)
        {
            DiceTypes mainType = diceType;
            DiceTypes weaknessProtection = diceType;
            DiceTypes anethemaProtection = diceType;

            switch (diceType)
            {
                case DiceTypes.TypeA:
                    weaknessProtection = DiceTypes.TypeD;
                    anethemaProtection = DiceTypes.TypeE;
                    break;
                case DiceTypes.TypeB:
                    weaknessProtection = DiceTypes.TypeE;
                    anethemaProtection = DiceTypes.TypeA;
                    break;
                case DiceTypes.TypeC:
                    weaknessProtection = DiceTypes.TypeA;
                    anethemaProtection = DiceTypes.TypeD;
                    break;
                case DiceTypes.TypeD:
                    weaknessProtection = DiceTypes.TypeB;
                    anethemaProtection = DiceTypes.TypeE;
                    break;
                case DiceTypes.TypeE:
                    weaknessProtection = DiceTypes.TypeC;
                    anethemaProtection = DiceTypes.TypeA;
                    break;
                default:
                    break;
            }

            m_diceRoll[0] = Factory.CreateDiceSide(1, mainType);
            m_diceRoll[1] = Factory.CreateDiceSide(2, mainType);
            m_diceRoll[2] = Factory.CreateDiceSide(3, mainType);
            m_diceRoll[3] = Factory.CreateDiceSide(4, mainType);
            m_diceRoll[4] = Factory.CreateDiceSide(1, weaknessProtection);
            m_diceRoll[5] = Factory.CreateDiceSide(2, anethemaProtection);
        }
Example #4
0
 private void SetDice(Dice[] targetPlayerDiceArray, int idx, DiceTypes diceType)
 {
     Dice d = new Dice();
     d.Init(diceType);
     targetPlayerDiceArray[idx] = d;
 }
Example #5
0
 public bool IsDiceAnthemaToOtherDice(DiceTypes dice, DiceTypes otherDice)
 {
     return refAnthema[dice] == otherDice;
 }