本文整理汇总了C#中Vessel.GetVesselCrew方法的典型用法代码示例。如果您正苦于以下问题:C# Vessel.GetVesselCrew方法的具体用法?C# Vessel.GetVesselCrew怎么用?C# Vessel.GetVesselCrew使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vessel
的用法示例。
在下文中一共展示了Vessel.GetVesselCrew方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProtoSignalProcessor
public ProtoSignalProcessor(ProtoPartModuleSnapshot ppms, Vessel v)
{
mVessel = v;
Powered = ppms.GetBool("IsRTPowered");
IsCommandStation = Powered && v.HasCommandStation() && v.GetVesselCrew().Count >= 6;
RTLog.Notify("ProtoSignalProcessor(Powered: {0}, HasCommandStation: {1}, Crew: {2})", Powered, v.HasCommandStation(), v.GetVesselCrew().Count);
}
示例2: ProtoSignalProcessor
public ProtoSignalProcessor(ProtoPartModuleSnapshot ppms, Vessel v)
{
Vessel = v;
Powered = ppms.GetBool("IsRTPowered");
CommandStation = Powered && v.HasCommandStation() && v.GetVesselCrew().Count >= 6;
RTUtil.Log("ProtoSignalProcessor: Powered: {0}, CommandStation: {1}, Crew: {2}",
Powered, v.HasCommandStation(), v.GetVesselCrew().Count);
}
示例3: ProtoSignalProcessor
public ProtoSignalProcessor(ProtoPartModuleSnapshot ppms, Vessel v)
{
Vessel = v;
Powered = ppms.GetBool("IsRTPowered");
// get the crew count from the vessel
var crewcount = v.GetVesselCrew().Count;
// when the crew count is equal to 0 then look into the protoVessel
if (crewcount == 0 && v.protoVessel.GetVesselCrew() != null)
crewcount = v.protoVessel.GetVesselCrew().Count;
RTLog.Notify("ProtoSignalProcessor crew count of {0} is {1}", v.vesselName, crewcount);
int ppmsMinCrew;
//try to get the RTCommandMinCrew value in the ProtoPartModuleSnapshot
if (ppms.GetInt("RTCommandMinCrew", out ppmsMinCrew))
{
IsCommandStation = Powered && v.HasCommandStation() && crewcount >= ppmsMinCrew;
RTLog.Notify("ProtoSignalProcessor(Powered: {0}, HasCommandStation: {1}, Crew: {2}/{3})",
Powered, v.HasCommandStation(), crewcount, ppmsMinCrew);
}
else
{
// there was no RTCommandMinCrew member in the ProtoPartModuleSnapshot
IsCommandStation = false;
RTLog.Notify("ProtoSignalProcessor(Powered: {0}, HasCommandStation: {1}, Crew: {2})",
Powered, v.HasCommandStation(), crewcount);
}
}
示例4: CSXCrewManagement
public CSXCrewManagement(Vessel vessel)
{
crews = new List<CSXCrew>();
foreach (ProtoCrewMember crew in vessel.GetVesselCrew())
crews.Add(new CSXCrew(crew));
}
示例5: GetVesselCrew
/// <summary>
/// Gets the vessel crew and works for EVAs as well
/// </summary>
/// <param name="v"></param>
/// <returns></returns>
public static IEnumerable<ProtoCrewMember> GetVesselCrew(Vessel v)
{
if (v == null)
{
yield break;
}
// EVA vessel
if (v.vesselType == VesselType.EVA)
{
if (v.parts == null)
{
yield break;
}
foreach (Part p in v.parts)
{
foreach (ProtoCrewMember pcm in p.protoModuleCrew)
{
yield return pcm;
}
}
}
else
{
// Vessel with crew
foreach (ProtoCrewMember pcm in v.GetVesselCrew())
{
yield return pcm;
}
}
}
示例6: ProtoSignalProcessor
public ProtoSignalProcessor(ProtoPartModuleSnapshot ppms, Vessel v)
{
mVessel = v;
Powered = ppms.GetBool("IsRTPowered");
// get the crew count from the vessel
int crewcount = v.GetVesselCrew().Count;
// when the crewcount is eq 0 than look into the protoVessel
if (crewcount == 0 && v.protoVessel.GetVesselCrew() != null)
crewcount = v.protoVessel.GetVesselCrew().Count;
RTLog.Notify("ProtoSignalProcessor crew count of {0} is {1}", v.vesselName, crewcount);
try {
IsCommandStation = Powered && v.HasCommandStation() && crewcount >= ppms.GetInt("RTCommandMinCrew");
RTLog.Notify("ProtoSignalProcessor(Powered: {0}, HasCommandStation: {1}, Crew: {2}/{3})",
Powered, v.HasCommandStation(), crewcount, ppms.GetInt("RTCommandMinCrew"));
} catch (ArgumentException argexeception) {
// I'm assuming this would get thrown by ppms.GetInt()... do the other functions have an exception spec?
IsCommandStation = false;
RTLog.Notify("ProtoSignalProcessor(Powered: {0}, HasCommandStation: {1}, Crew: {2})",
Powered, v.HasCommandStation(), crewcount);
RTLog.Notify("ProtoSignalProcessor ", argexeception);
}
}
示例7: OnVesselRecovered
private void OnVesselRecovered(Vessel vessel)
{
// When a vessel is recovered ensure that all kerbals are removed from the used/dead lists.
foreach (var crewMember in vessel.GetVesselCrew())
{
usedKerbals.Remove(crewMember.name);
deadKerbals.Remove(crewMember.name);
}
}
示例8: SetCrew
protected void SetCrew(Vessel v)
{
LoggingUtil.LogVerbose(this, "Setting crew to those on vessel " + v.vesselName);
foreach (ProtoCrewMember pcm in v.GetVesselCrew())
{
LoggingUtil.LogVerbose(this, " Adding " + pcm.name + " to crew list.");
crew.AddUnique(pcm);
}
}
示例9: RecordDocking
public void RecordDocking(Vessel vessel)
{
List<ProtoCrewMember> crew = vessel.GetVesselCrew();
foreach (ProtoCrewMember member in crew)
{
Log.Info("kerbal " + member.name + " docked");
hallOfFame.RecordDocking(member);
}
}
示例10: HasCrew
public static bool HasCrew(Vessel v, string skill)
{
var crew = v.GetVesselCrew();
var count = crew.Count;
for (int i = 0; i < count; ++i)
{
if (crew[i].experienceTrait.TypeName == skill)
return true;
}
return false;
}
示例11: GetTotalWaitTime
public static double GetTotalWaitTime(Vessel vessel)
{
double waitTotal = 0;
if (RemoteTechHook.IsAvailable(vessel.id) && vessel.GetVesselCrew().Count == 0)
{
waitTotal = RemoteTechHook.Instance.GetShortestSignalDelay(vessel.id);
}
return waitTotal;
}
示例12: RecordLaunch
public void RecordLaunch(Vessel vessel)
{
List<ProtoCrewMember> crew = vessel.GetVesselCrew();
foreach (ProtoCrewMember member in crew)
{
if (!member.IsTourist())
{
Log.Info("kerbal " + member.name + " launched");
hallOfFame.RecordLaunch(member);
}
}
}
示例13: OnVesselChanged
private void OnVesselChanged(Vessel vessel)
{
if (FlightGlobals.ActiveVessel != vessel)
return;
// Keep track of which kerbals has been used, to know if a penalty is appropriate or not when a kerbal dies.
foreach (var crewMember in vessel.GetVesselCrew())
{
usedKerbals.Add(crewMember.name);
deadKerbals.Remove(crewMember.name);
}
}
示例14: RecycleKerbal
public float RecycleKerbal(Vessel v)
{
if (!v.isEVA)
return 0;
// idea and numbers taken from Kethane
if (v.GetVesselCrew()[0].isBadass) {
v.rootPart.explosionPotential = 10000;
}
FlightGlobals.ForceSetActiveVessel(this.vessel);
v.rootPart.explode();
float mass = 0;
mass += ReclaimResource("Kethane", 150, v.name);
mass += ReclaimResource("Metal", 1, v.name);
return mass;
}
示例15: Record
public void Record(Ribbon ribbon, Vessel vessel)
{
if(vessel==null)
{
Log.Warning("no vessel for recorded ribbon "+ribbon.GetName());
return;
}
if (Log.IsLogable(Log.LEVEL.DETAIL)) Log.Detail("recording ribbon "+ribbon.GetName()+" for vessel "+vessel.GetName());
List<ProtoCrewMember> crew = vessel.GetVesselCrew();
if (crew != null)
{
hallOfFame.BeginArwardOfRibbons();
foreach (ProtoCrewMember member in crew)
{
if(!member.IsTourist())
{
Record(ribbon, member);
}
}
hallOfFame.EndArwardOfRibbons();
}
}