예제 #1
0
 void GameClear()
 {
     if (game != null) {
         game.Stop();
         gameAppearence.ClearCache();
         game = null;
         gameAppearence = null;
     }
     tsmiPause.Enabled = false;
     gameStatusLeftWords.Text = "Осталось слов:";
     gameStatusErrors.Text = "Ошибок:";
 }
예제 #2
0
 void GameCreateAndStart()
 {
     try {
         game = new Game(20, 15, gameSettings);
     } catch (InvalidOperationException ex) {
         MessageBox.Show(this, ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     gameAppearence = new GameAppearence(game);
     gameAppearence.MainFont = Font;
     gameAppearence.GrayCellImageData = CommonHelper.GetResourceData("WordGame.Data.cell.bmp");
     game.OnStartLetterDieAnimation += new StartLetterDieAnimationHandler(game_OnStartLetterDieAnimation);
     game.OnStartWordAndLetterDieAnimation += new StartWordAndLetterDieAnimationHandler(game_OnStartWordAndLetterDieAnimation);
     game.OnUpdateScreen += new EventHandler(game_OnUpdateScreen);
     gameAppearence.UpdateScreenSize(gamePanel.ClientSize);
     game.StartGameThreads();
     timer1.Enabled = true;
     tsmiPause.Enabled = true;
 }
        static void Main(string[] args)
        {
            #if DEVELOP

            foreach (var testCase in TestCases)
            {
                using (var reader = new StringReader(testCase))
                {
                    using (var game = new Game(reader, Console.Out))
                    {
                        // Everything is handled internal to the game.
                    }
                }
            }

            #else

            using (var game = new Game(Console.In, Console.Out))
            {
                // Everything is handled internal to the game.
            }

            #endif
        }
예제 #4
0
 public GameAppearence(Game game)
 {
     this.game = game;
     this.prevDrawMap = new GameMap<DrawCellInfo>(game.MainTable.Width + 1, game.MainTable.Height, true);
     this.randomize = new Random(DateTime.Now.GetHashCode());
 }