Пример #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);
            }
        }