Beispiel #1
0
        internal _GAME_3BGameOver(_GAME_3BMatrixViewModel bubbleMatrix)
        {
            if (bubbleMatrix == null)
            {
                throw new ArgumentNullException("bubbleMatrix");
            }

            _bubbleMatrix = bubbleMatrix;

            if (bubbleMatrix.Bubbles.Count == 0)
            {
                this.Title = "CONGRATULATIONS!";
            }
            else
            {
                string theLetterS = bubbleMatrix.Bubbles.Count == 1 ? string.Empty : "S";
                this.Title = string.Format(CultureInfo.CurrentCulture, "{0} BUBBLE{1} LEFT", bubbleMatrix.Bubbles.Count, theLetterS);
            }

            this.Subtitle = "Most bubbles popped at once: " + bubbleMatrix.MostBubblesPoppedAtOnce;

            this.QuitCommand = new RelayCommand(Application.Current.Shutdown);
        }
Beispiel #2
0
        internal _GAME_3BViewModel(_GAME_3BMatrixViewModel bubbleMatrix, int row, int column)
        {
            if (bubbleMatrix == null)
            {
                throw new ArgumentNullException("bubbleMatrix");
            }

            if (row < 0 || bubbleMatrix.RowCount <= row)
            {
                throw new ArgumentOutOfRangeException("row");
            }

            if (column < 0 || bubbleMatrix.ColumnCount <= column)
            {
                throw new ArgumentOutOfRangeException("column");
            }

            _bubbleMatrix = bubbleMatrix;

            _locationManager = new _3BLocationManager();
            _locationManager.MoveTo(row, column);

            this.BubbleType = GetRandomBubbleType();
        }
 internal _GAME_3BTaskManager(_GAME_3BMatrixViewModel bubbleMatrix)
 {
     _bubblesTaskFactory = new _3BTaskFactory(bubbleMatrix);
     _pendingTasks       = new Queue <_GAME_3BTask>();
     _undoStack          = new Stack <IEnumerable <_GAME_3BTask> >();
 }