Esempio n. 1
0
        /// <summary>
        /// Constructs a new game.
        /// </summary>
        public static void NewGame()
        {
            // Clear the display
            Display.Sprites.Clear();

            // Create the objects
            theme          = Config.Theme;
            language       = Config.Language;
            score          = new Score();
            tokenGenerator = new TokenGenerator();
            gameState      = GameState.Started;
            board          = new Board(Config.BoardSize);

            // Register the vents
            board.TokenAdded   += Display.OnTokenAdded;
            board.TokenRemoved += Display.OnTokenRemoved;
            board.TokenChanged += Display.OnTokenChanged;

            // Initialize the board
            board.Initialize();
        }
Esempio n. 2
0
        /// <summary>
        /// Constructs a new game.
        /// </summary>
        public static void NewGame()
        {
            // Clear the display
            Display.Sprites.Clear();

            // Create the objects
            theme = Config.Theme;
            language = Config.Language;
            score = new Score();
            tokenGenerator = new TokenGenerator();
            gameState = GameState.Started;
            board = new Board(Config.BoardSize);

            // Register the vents
            board.TokenAdded += Display.OnTokenAdded;
            board.TokenRemoved += Display.OnTokenRemoved;
            board.TokenChanged += Display.OnTokenChanged;

            // Initialize the board
            board.Initialize();
        }