public NightVisionDevice(SmallArms smallArms) { this.MaxWeight = smallArms.MaxWeight; WeightModification = 3; this.smallArms = smallArms; this.Weight = this.smallArms.Weight + WeightModification; }
public bool ChooseSmallArms() { //Console.Clear(); Console.WriteLine("Оберіть зброю: \n 1-AutomaticRifle\n 2-Pistol\n 3-AssaultRifle\n Інше -Вихід"); int choose = Convert.ToInt32(Console.ReadLine()); switch (choose) { case 1: { EnterСharacteristics(out double flightRange, out double power, out double weight, out int year); smallArms = new AutomaticRifle(flightRange, power, weight, year); return(true); } case 2: { EnterСharacteristics(out double flightRange, out double power, out double weight, out int year); smallArms = new Pistol(flightRange, power, weight, year); return(true); } case 3: { EnterСharacteristics(out double flightRange, out double power, out double weight, out int year); smallArms = new AssaultRifle(flightRange, power, weight, year); return(true); } default: { smallArms = null; return(false); } } }
public Sight(SmallArms smallArms) { this.MaxWeight = smallArms.MaxWeight; WeightModification = 2.5; this.smallArms = smallArms; this.Weight = this.smallArms.Weight + WeightModification; }
public void AddNightVisionDevice() { smallArms = new NightVisionDevice(smallArms); }
public void AddSilencer() { smallArms = new Silencer(smallArms); }
public void AddSight() { smallArms = new Sight(smallArms); }