Exemplo n.º 1
0
 private void RollDice(Dice a_dice)
 {
     a_dice.Roll();
     foreach (DiceGameObserver o in m_observers) {
         o.DiceRolled(a_dice.GetValue());
     }
 }
Exemplo n.º 2
0
 private void RollDice(Dice a_dice)
 {
     a_dice.Roll();
     foreach (DiceGameObserver o in m_observers)
     {
         o.DiceRolled(a_dice.GetValue());
     }
 }
        private void RollDice(Dice a_dice)
        {
            a_dice.Roll();                                                          // rolla tärningen och får värdet
            foreach (DiceGameObserver o in m_observers)
            {
                o.DiceRolled(a_dice.GetValue());

            }
        }
Exemplo n.º 4
0
        public bool Play()
        {
            RollDice(m_d1);
            System.Threading.Thread.Sleep(2000);
            RollDice(m_d2);
            System.Threading.Thread.Sleep(2000);
            RollDice(m_d3);

            return(m_d1.GetValue() + m_d2.GetValue() + m_d3.GetValue() == 9);
        }
Exemplo n.º 5
0
 public int GetDice2Value()
 {
     return(m_d2.GetValue());
 }
Exemplo n.º 6
0
 public int GetDice1Value()
 {
     return(m_d1.GetValue());
 }