public static VonNeumannDiscTypes DiscTypeFromMissionSection(Section section) { VonNeumannDiscTypes neumannDiscTypes = VonNeumannDiscTypes.IMPACTOR; string upper = section.ShipSectionAsset.SectionName.ToUpper(); for (int index = 0; index < 10; ++index) { if (upper.Contains(VonNeumannDiscControl._vonneumannDiscTypes[index])) { neumannDiscTypes = (VonNeumannDiscTypes)index; break; } } return(neumannDiscTypes); }
public static bool DiscTypeIsAttacker(VonNeumannDiscTypes type) { switch (type) { case VonNeumannDiscTypes.IMPACTOR: case VonNeumannDiscTypes.POSSESSOR: case VonNeumannDiscTypes.DISINTEGRATOR: case VonNeumannDiscTypes.EMPULSER: case VonNeumannDiscTypes.EMITTER: case VonNeumannDiscTypes.ABSORBER: case VonNeumannDiscTypes.OPRESSOR: return(true); default: return(false); } }
public VonNeumannDiscControl(App game, Ship ship) { this.m_Game = game; this.m_Disc = ship; this.m_DiscType = VonNeumannDiscControl.DiscTypeFromMissionSection(ship.Sections.FirstOrDefault <Section>((Func <Section, bool>)(x => x.ShipSectionAsset.Type == ShipSectionType.Mission))); }