public static bool TryCreate <TAmmo>(float weight, GunType typeOfGun, Ammo.TypeOfBoost boostType, TAmmo ammoType, out MachineGun machineGun) where TAmmo : IAmmo { if (AvailableAmmoTypes().Contains(typeof(TAmmo))) { machineGun = new MachineGun(weight, typeOfGun, boostType, ammoType); return(true); } machineGun = null; return(false); }
public static bool TryCreate <TAmmo>(float weight, GunType typeOfGun, Ammo.TypeOfBoost boostType, TAmmo ammoType, out PlasmaCannon plasmaCannon) where TAmmo : IAmmo { if (AvailableAmmoTypes().Contains(typeof(TAmmo))) { plasmaCannon = new PlasmaCannon(weight, typeOfGun, boostType, ammoType); return(true); } plasmaCannon = null; return(false); }
private MachineGun(float weight, GunType typeOfGun, Ammo.TypeOfBoost boostType, IAmmo ammoType) : base(weight, typeOfGun, boostType, ammoType) { }
private PlasmaCannon(float weight, GunType typeOfGun, Ammo.TypeOfBoost boostType, IAmmo ammoType) : base(weight, typeOfGun, boostType, ammoType) { }