public void addNewWeapon(string objectSource,Weapon weapon) { if (weaponList == null) weaponList = new Dictionary<string, Weapon>(); //Verify the type of weapon to return weaponList.Add(objectSource, getWeaponType(weapon)); }
private Weapon getWeaponType(Weapon weapon) { if (weapon is RocketLaucher) { RocketLaucher rocketLaucher = new RocketLaucher(); rocketLaucher.init(null); return rocketLaucher; } return null; }