Example #1
0
        public void GetTextBox()
        {
            Gauls gauls = new Gauls();
            Assert.AreEqual("t1", gauls.GetTextBoxName("Phalanx"));
            Assert.AreEqual("t6", gauls.GetTextBoxName("Haeduan"));
            Assert.AreEqual("t9", gauls.GetTextBoxName("unit u29"));
            Assert.AreEqual("t10", gauls.GetTextBoxName("Settler"));
            Console.WriteLine(gauls.UnitList());

            Romans romans = new Romans();
            Assert.AreEqual("t1", romans.GetTextBoxName("Phalanx"));
            Assert.AreEqual("t6", romans.GetTextBoxName("EquitesCaesaris"));
            Console.WriteLine(romans.UnitList());

            Teutons teutons = new Teutons();
            Assert.AreEqual("t1", teutons.GetTextBoxName("EquitesCaesaris"));
            Assert.AreEqual("t4", teutons.GetTextBoxName("Scout"));
            Console.WriteLine(teutons.UnitList());
        }
Example #2
0
 private string SetPlayerFarmUnits(Tribes playersTribe)
 {
     string[] list = farmUnits.Split(',');
     string farmUnitList;
     switch (playersTribe)
     {
         case Tribes.Teutons:
         {
             Teutons teutons = new Teutons();
             farmUnitList = teutons.GetClassNames(list);
             break;
         }
         case Tribes.Gauls:
         {
             Gauls gauls = new Gauls();
             farmUnitList = gauls.GetClassNames(list);
             break;
         }
         case Tribes.Romans:
         {
             Romans romans = new Romans();
             farmUnitList = romans.GetClassNames(list);
             break;
         }
         default:
         {
             throw new NotImplementedException("Unknown Tribe specified!!!");
         }
     }
     return farmUnitList;
 }
Example #3
0
        private static string GetUnitTextBox(Tribes tribes,
            string troopName)
        {
            string textBoxName = "t1";
            switch (tribes)
            {
                case Tribes.Gauls:
                {
                    Gauls units = new Gauls();
                    textBoxName = units.GetTextBoxName(troopName);
                    break;
                }

                case Tribes.Romans:
                {
                    Romans units = new Romans();
                    textBoxName = units.GetTextBoxName(troopName);
                    break;
                }

                case Tribes.Teutons:
                {
                    Romans units = new Romans();
                    textBoxName = units.GetTextBoxName(troopName);
                    break;
                }

                default:
                {
                    break;
                }
            }
            return textBoxName;
        }