Exemplo n.º 1
0
        /// <summary>
        /// A button event that clears the division of selected prize levels
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void clearDivisionButton_Click(object sender, RoutedEventArgs e)
        {
            DivModel.clearPrizeLevelList();
            for (int i = 0; i < DivisionModel.MAX_PRIZE_BOXES; i++)
            {
                DivModel.levelBoxes[i].IsSelected = false;
            }

            DivModel.TotalPlayerPicks = DivModel.calculateTotalCollections();
            DivModel.TotalPrizeValue  = DivModel.calculateDivisionValue();
            SectionContainer.validateDivision();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Updates the total player picks and total value based on the selected prize levels
        /// </summary>
        public void updateInfo()
        {
            if (Prizes.getNumPrizeLevels() > 0)
            {
                DivModel.clearPrizeLevelList();
                for (int i = 0; i < Prizes.getNumPrizeLevels(); i++)
                {
                    if (DivModel.levelBoxes[i].IsSelected)
                    {
                        DivModel.addPrizeLevel(Prizes.getPrizeLevel(i));
                    }
                }

                DivModel.TotalPlayerPicks = DivModel.calculateTotalCollections();
                DivModel.TotalPrizeValue  = DivModel.calculateDivisionValue();
            }

            SectionContainer.validateDivision();
        }
Exemplo n.º 3
0
        /// <summary>
        /// Listens for "shouts" made by other classes, if it is subscribed to that class
        /// </summary>
        /// <param name="pass"></param>
        public void onListen(object pass)
        {
            if (pass is PrizeLevels.PrizeLevels)
            {
                Prizes = (PrizeLevels.PrizeLevels)pass;

                for (int i = 0; i < DivisionModel.MAX_PRIZE_BOXES; i++)
                {
                    DivModel.levelBoxes[i].IsAvailable = false;
                }

                for (int i = 0; i < Prizes.getNumPrizeLevels(); i++)
                {
                    DivModel.levelBoxes[i].IsAvailable = true;
                }

                DivModel.clearPrizeLevelList();
                updateDivision();
            }
        }