示例#1
0
        private List<Tuple<int, List<int>>> CreateColumns(GameField gameField)
        {
            var result = new List<Tuple<int, List<int>>>();
            var cells = new List<int>();

            for (int i = 0; i < gameField.Height; i++)
            {
                cells.Add(50);
            }

            for (int i = 0; i < gameField.Width; i++)
            {
                result.Add(Tuple.Create(i, cells));
            }

            return result;
        }
示例#2
0
        public GameViewModel(INavigationService navigation)
        {
            this.navigation = navigation;
            field = new GameField(7, 7, new GameRules());
            Columns = CreateColumns(field);

            Cells = new ObservableCollection<CellViewModel> { new CellViewModel(field.NextCell, this) };
            DropStarCommand = new DelegateCommand<object>(OnExecutedDropStar);
        }