forked from jkoritzinsky/Extensive-Engineer-Report
/
LandingLegsButNoLights.cs
34 lines (30 loc) · 1.1 KB
/
LandingLegsButNoLights.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using PreFlightTests;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace JKorTech.Extensive_Engineer_Report
{
public class LandingLegsButNoLights : SectionDesignConcernBase
{
public override string GetConcernDescription()
{
return "Your vessel has landing legs or wheels but no lights. Add lights to make night landings possible.";
}
public override string GetConcernTitle()
{
return "Missing lights for night landing";
}
public override DesignConcernSeverity GetSeverity()
{
return DesignConcernSeverity.NOTICE;
}
public override bool TestCondition(IEnumerable<Part> sectionParts)
{
var hasLights = sectionParts.AnyHasModule<ModuleLight>();
var hasLandingLegs = sectionParts.AnyHasModule<ModuleLandingLeg>() || sectionParts.AnyHasModule<ModuleLandingGear>()
|| sectionParts.AnyHasModule<ModuleLandingGearFixed>();
return !hasLandingLegs || hasLights;
}
}
}