public void Create_Guns(string type) { if (type == "S") { Sniper temp = WeaponsFacotry.CreateWeapon(type) as Sniper; Assert.AreEqual(10, temp.ammo); Assert.AreEqual("AWP", temp.name); Assert.AreEqual(75, temp.damage); Assert.AreEqual(900, temp.cost); } else if (type == "A") { Automat temp = WeaponsFacotry.CreateWeapon(type) as Automat; Assert.AreEqual(30, temp.ammo); Assert.AreEqual("AK-47", temp.name); Assert.AreEqual(45, temp.damage); Assert.AreEqual(750, temp.cost); } else if (type == "P") { Pistol temp = WeaponsFacotry.CreateWeapon(type) as Pistol; Assert.AreEqual(7, temp.ammo); Assert.AreEqual("Desert Eagle", temp.name); Assert.AreEqual(30, temp.damage); Assert.AreEqual(500, temp.cost); } else if (type == "B") { Bazooka temp = WeaponsFacotry.CreateWeapon(type) as Bazooka; Assert.AreEqual(1, temp.ammo); Assert.AreEqual("RukyBazuky", temp.name); Assert.AreEqual(100, temp.damage); Assert.AreEqual(1000, temp.cost); } else { Granade temp = WeaponsFacotry.CreateWeapon(type) as Granade; Assert.AreEqual(1, temp.ammo); Assert.AreEqual("small", temp.name); Assert.AreEqual(10, temp.damage); Assert.AreEqual(0, temp.cost); } }
public PlayerConfigurator AddPistol() { WeaponsFacotry naujas; naujas = new WeaponsFacotry(); Weapon Temp = naujas.CreateWeapon("P"); this.player.addGuns(Temp); return(this); }