Пример #1
0
        public ClassSelectButton(Rectangle loc, Texture2D t, string n, Color s, SpriteFont sf)
            : base(loc, t, n, s, sf)
        {
            listOfUnits = new FileInput("Content/Units.txt", "Textures.txt");
            listOfUnits.LoadUnit();


            classOptions = new List <MenuButton>();

            for (int i = 0; i < listOfUnits.UnitList.Count(); i++)
            {
                // This now loads from the notepad document instead
                String temp = "";
                temp = listOfUnits.UnitList[i].Name;
                #region

                /* switch (i)
                 * {
                 *   case 0:
                 *       temp = listOfUnits.UnitList[i].Name;
                 *       break;
                 *   case 1:
                 *       temp = "Shotgun";
                 *       break;
                 *   case 2:
                 *       temp = "Alien";
                 *       break;
                 *   case 3:
                 *       temp = "Engineer";
                 *       break;
                 *   case 4:
                 *       temp = "Minigun";
                 *       break;
                 *   case 5:
                 *       temp = "Assasin";
                 *       break;
                 *   case 6:
                 *       temp = "Sniper";
                 *       break;
                 *   case 7:
                 *       temp = "Medic";
                 *       break;
                 *   case 8:
                 *       temp = "Buff";
                 *       break;
                 * }*/
                #endregion
                classOptions.Add(new MenuButton(loc, t, temp, s, sf, false));
                classOptions[i].Y -= 50 * (i + 1);
            }
            clicked = false;
        }
Пример #2
0
 // Take in a string with a file name, and move all the file input to here
 public GameManager(String fileName, String texturesFileName, MouseState curMouse, MouseState prevMosue, UserInterface ui)
 {
     allUnits       = new FileInput(fileName, texturesFileName);
     player1Units   = new List <Unit>();
     enemy_Units    = new List <Enemy>();
     unitTextures   = new List <Texture2D>();
     unitIcons      = new Dictionary <string, Texture2D>();
     curGameState   = GameState.Menu;
     menu           = new MenuHandler(MenuStates.Main);
     gameMap        = new Map();
     timer          = 0;
     pausemenu      = new PauseMenu();
     userInterface  = ui;
     unitDictionary = new Dictionary <string, Unit>();
 }