示例#1
0
        public ModuleShipData GetCurrentModuleMount(
            ShipSectionAsset section,
            string mountNodeName)
        {
            SectionShipData sectionShipData = this.GetCurrentSections().FirstOrDefault <SectionShipData>((Func <SectionShipData, bool>)(x => x.Section == section));

            if (sectionShipData == null)
            {
                return((ModuleShipData)null);
            }
            return(sectionShipData.Modules.FirstOrDefault <ModuleShipData>((Func <ModuleShipData, bool>)(x => x.ModuleMount.NodeName == mountNodeName)));
        }
示例#2
0
        public IEnumerable <ModuleShipData> GetCurrentSectionModules(
            ShipSectionType sectionType)
        {
            SectionShipData section = this.GetCurrentSectionData(sectionType);

            if (section != null)
            {
                foreach (ModuleShipData module in section.Modules)
                {
                    yield return(module);
                }
            }
        }
示例#3
0
        public IEnumerable <WeaponBankShipData> GetCurrentWeaponBanks(
            ShipSectionType sectionType)
        {
            SectionShipData section = this.GetCurrentSectionData(sectionType);

            if (section != null)
            {
                foreach (WeaponBankShipData weaponBank in section.WeaponBanks)
                {
                    yield return(weaponBank);
                }
            }
        }
示例#4
0
        public IEnumerable <SectionShipData> GetCurrentSections()
        {
            SectionShipData mission = this.GetCurrentSectionData(ShipSectionType.Mission);

            if (mission != null)
            {
                yield return(mission);
            }
            SectionShipData command = this.GetCurrentSectionData(ShipSectionType.Command);

            if (command != null)
            {
                yield return(command);
            }
            SectionShipData engine = this.GetCurrentSectionData(ShipSectionType.Engine);

            if (engine != null)
            {
                yield return(engine);
            }
        }