Exemple #1
0
        void LoadMenuEventHandler(Object sender, EventArgs e)
        {
            GameStateArgs args = (GameStateArgs)e;

            if (args.Args.Length > 0)
            {
                CurrentGameState = new Editor(RtsEventHandler, args.Args[0]);
            }
        }
Exemple #2
0
 void RtsEventHandler(Object sender, EventArgs e)
 {
     if (e is GameStateArgs)
     {
         GameStateArgs args = (GameStateArgs)e;
         if (args.Args.Length > 0)
         {
             if (args.Args[0] == "exit")
             {
                 Game.Exit();
             }
         }
     }
 }
Exemple #3
0
        void StartMenuEventHandler(Object sender, EventArgs e)
        {
            GameStateArgs args = (GameStateArgs)e;

            if (args.Args.Length > 0)
            {
                if (args.Args.Length == 3)
                {
                    if (args.Args[0] == "new")
                    {
                        CurrentGameState = new Editor(RtsEventHandler, int.Parse(args.Args[1]), int.Parse(args.Args[2]));
                    }
                }
                else if (args.Args[0] == "load")
                {
                    CurrentGameState = new LoadMenu(LoadMenuEventHandler);
                }
            }
        }