Пример #1
0
        /// <summary>
        /// Modify the Board and display the changes on the UI
        /// </summary>
        public void StartGameLoop()
        {
            do
            {
                Log.Debug("StartGameLoop() LOOP", 1);

                _boardViewGenerator.ChangeBoard(_map);

                Log.Debug("Builder().Bind()", 1);

                while (_builder.Bind())
                {
                }

                Log.Debug(-2, "Builder().Bind() END");

                _boardViewGenerator.GenerateFrames(_builder.Model, _builder.View);

                while (_boardViewGenerator.ShowNextFrame())
                {
                    Delay();
                }

                Delay();

                _builder = new BuilderViewModel(_map);

                Log.Debug(-1, "StartGameLoop() LOOP END\n");

                Console.WriteLine("\n\n");
            } while (ShouldRun());

            _file.Write(_map, _pathGenerator.Longest().GetByIndex(0));
        }
Пример #2
0
 public PyramidGame()
 {
     _map = new Map(1);
     _boardViewGenerator = new BoardViewModel(_map);
     _builder            = new BuilderViewModel(_map);
     _view          = new PyramidView();
     _file          = new FileAccess();
     _pathGenerator = new PathGenerator(_map, new BuilderRules());
 }
Пример #3
0
        public void Initialize()
        {
            if (_file.CanRead())
            {
                _map = _file.Read();
            }
            else
            {
                _map = new Map(Random.Next(3, 10), Random.Next(3, 13));
            }

            _builder = new BuilderViewModel(_map);
        }