Beispiel #1
0
        protected override void Initialize()
        {
            spriteManager = new SpriteManager(this);
            Components.Add(spriteManager);

            base.Initialize();

            gameGateway.OnGameFinished += GameFinishedHandler;

            LoginForm loginForm = new LoginForm();
            loginForm.OnStartWithAI += (nickname) =>
            {
                gameGateway.SpriteManager = spriteManager;
                gameGateway.StartGame();
            };
            loginForm.OnStartWithNetUser += (nickname) => { MessageBox.Show("Comming soon"); };
            loginForm.OnAboutShow += () =>
            {
                About about = new About();
                about.ShowDialog();
            };
            loginForm.OnExit += () => { _exitCommand = true; };

            loginForm.ShowDialog();
        }
Beispiel #2
0
 private void GameFinishedHandler(string status)
 {
     ResultWindow result = new ResultWindow(status);
     result.OnStartWithAI += () =>
     {
         gameGateway.SpriteManager = spriteManager;
         gameGateway.StartGame();
     };
     result.OnStartWithNetUser += () => { MessageBox.Show("Comming soon"); };
     result.OnAboutShow += () =>
     {
         About about = new About();
         about.ShowDialog();
     };
     result.OnExit += () => { _exitCommand = true; };
     result.ShowDialog();
 }