public void RemoveTubeLoadTypes(int hardpointIndex, MissileWeaponTypes types) { HardpointID id = GetHardpointID(HardpointTypes.Tube, hardpointIndex, true); if (id == null) { return; } (Weapons[id].MountedWeapon as TubeTemplate).AllowedLoadings &= ~types; }
protected HardpointID GetHardpointID(HardpointTypes type, int index, bool checkType) { HardpointID id = new HardpointID(type, index); if (!Weapons.ContainsKey(id) || (checkType && Weapons[id].MountedWeapon.WeaponType != GetStandardWeaponTypeForMount(type))) { return(null); } return(id); }
public MissileWeaponTypes GetTubeLoadTypes(int hardpointIndex) { HardpointID id = GetHardpointID(HardpointTypes.Tube, hardpointIndex, true); if (id == null) { return(MissileWeaponTypes.None); } return((Weapons[id].MountedWeapon as TubeTemplate).AllowedLoadings); }
public WeaponMount FindWeaponMount(HardpointTypes type, int index) { HardpointID id = new HardpointID(type, index); if (Weapons.ContainsKey(id)) { return(Weapons[id]); } WeaponMount mount = new WeaponMount(); mount.Hardpoint = id; Weapons.Add(id, mount); return(mount); }