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))); }
public IEnumerable <ModuleShipData> GetCurrentSectionModules( ShipSectionType sectionType) { SectionShipData section = this.GetCurrentSectionData(sectionType); if (section != null) { foreach (ModuleShipData module in section.Modules) { yield return(module); } } }
public IEnumerable <WeaponBankShipData> GetCurrentWeaponBanks( ShipSectionType sectionType) { SectionShipData section = this.GetCurrentSectionData(sectionType); if (section != null) { foreach (WeaponBankShipData weaponBank in section.WeaponBanks) { yield return(weaponBank); } } }
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); } }