void CreateAndShowMainMenu()
        {
            CameraFreeze();
            XMLLoader xmlLoader = new XMLLoader();
            xmlLoader.Load("Profiles\\profiles.xml");
            userList = new UsersList(xmlLoader.Document);

            mainMenu = new MainMenu(this.Game, ref userList);
            mainMenu.OnNewGameStartClick += new EventHandler<MainMenuEventArgs>(mainMenu_OnNewGameStartClick);
            mainMenu.OnExitClick += new EventHandler(mainMenu_OnExitClick);
            mainMenu.OnDeleteUserClick += new EventHandler<MainMenuEventArgs>(mainMenu_OnDeleteUSerClick);
            mainMenu.OnLoadGameClick += new EventHandler<MainMenuEventArgs>(mainMenu_OnLoadGameClick);

            pointer = new Sprite(this.Game, GraphicsCollection.GetPack("pointer"));
            pointer.XRelative = 0;
            pointer.YRelative = 0;
            pointer.DrawOrder = 10000;
        }
Esempio n. 2
0
        public MainMenu(Game game, ref UsersList list)
            : base(game)
        {
            graphicsCollection = (GraphicsCollection)Game.Services.GetService(typeof(GraphicsCollection));
            randomSlot = new Random();
                        
            uList = list;
            usersList = new List<string> { };
            for (int i = 0; i < list.Count; i++)
                usersList.Add(list[i].Name);

            InitialState();
            Game.Components.Add(this);
        }