예제 #1
0
        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;
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }