本文整理汇总了C#中ProtoCrewMember类的典型用法代码示例。如果您正苦于以下问题:C# ProtoCrewMember类的具体用法?C# ProtoCrewMember怎么用?C# ProtoCrewMember使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProtoCrewMember类属于命名空间,在下文中一共展示了ProtoCrewMember类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Kerbal
public Kerbal(ProtoCrewMember.Gender gender, string name)
{
Initialize(gender, name);
this.gender = gender;
this.name = name;
}
示例2: CanKerbalBeAdded
internal static bool CanKerbalBeAdded(ProtoCrewMember kerbal)
{
return ((SMSettings.RealismMode && SMAddon.SmVessel.IsRecoverable) || !SMSettings.RealismMode) &&
kerbal.rosterStatus == ProtoCrewMember.RosterStatus.Available &&
SMAddon.SmVessel.SelectedPartsSource.Count > 0 &&
!SMPart.IsCrewFull(SMAddon.SmVessel.SelectedPartsSource[0]);
}
示例3: IsQualifiedByMissionCount
private bool IsQualifiedByMissionCount(ProtoCrewMember kerbal)
{
HallOfFameEntry entry = HallOfFame.Instance().GetEntry(kerbal);
if (entry == null) return false;
if (entry.MissionsFlown < 50) return false;
return true;
}
示例4: PromoteIfEligible
public void PromoteIfEligible(ProtoCrewMember kerbal)
{
if(IsQualifiedByMissionCount(kerbal))
{
Promote(kerbal);
}
}
示例5: FetchKerbal
public LifeSupportStatus FetchKerbal(ProtoCrewMember crew)
{
if (!IsKerbalTracked(crew.name))
{
var k = new LifeSupportStatus();
k.KerbalName = crew.name;
k.HomeBodyId = FlightGlobals.GetHomeBodyIndex();
k.LastPlanet = FlightGlobals.GetHomeBodyIndex();
k.LastMeal = Planetarium.GetUniversalTime();
k.LastEC = Planetarium.GetUniversalTime();
k.LastAtHome = Planetarium.GetUniversalTime();
k.LastSOIChange = Planetarium.GetUniversalTime();
k.MaxOffKerbinTime = 648000; //TODO - make this configurable
k.TimeEnteredVessel = Planetarium.GetUniversalTime();
k.CurrentVesselId = "?UNKNOWN?";
k.PreviousVesselId = "??UNKNOWN??";
k.LastUpdate = Planetarium.GetUniversalTime();
k.IsGrouchy = false;
k.OldTrait = crew.experienceTrait.Title;
TrackKerbal(k);
}
var kerbal = LifeSupportInfo.FirstOrDefault(k => k.KerbalName == crew.name);
return kerbal;
}
示例6: GetEvaAction
public static EvaAction GetEvaAction(ProtoCrewMember kerbal, Vessel fromVessel)
{
if (fromVessel != null)
{
bool atmosphere = fromVessel.IsInAtmosphere();
bool oxygen = fromVessel.IsInAtmosphereWithOxygen();
if (Log.IsLogable(Log.LEVEL.DETAIL)) Log.Detail("creating EVA action for kerbal " + kerbal.name + " in atmosphere:" + atmosphere + ", oxygen:" + oxygen);
if (atmosphere && oxygen)
{
return ActionPool.ACTION_EVA_OXYGEN;
}
else if (atmosphere && ! oxygen)
{
return ActionPool.ACTION_EVA_INATM;
}
else if (!atmosphere)
{
return ActionPool.ACTION_EVA_NOATM;
}
else
{
Log.Warning("unexpected EVA situation");
return ActionPool.ACTION_EVA_NOATM;
}
}
else
{
Log.Warning("no vessel for kerbal "+kerbal.name+" on EVA");
return ActionPool.ACTION_EVA_NOATM;
}
}
示例7: addCrewObject
public void addCrewObject(ProtoCrewMember c)
{
Notes_CrewObject o = new Notes_CrewObject(c, this);
if (!allCrew.ContainsKey(c.name))
allCrew.Add(c.name, o);
}
示例8: OnKerbalStatusChange
private void OnKerbalStatusChange(ProtoCrewMember pcm, ProtoCrewMember.RosterStatus oldStatus, ProtoCrewMember.RosterStatus newStatus)
{
if (oldStatus == ProtoCrewMember.RosterStatus.Assigned && newStatus == ProtoCrewMember.RosterStatus.Available)
{
FlightLog tmpLog = new FlightLog();
foreach (FlightLog.Entry entry in pcm.careerLog.Entries.Union(pcm.flightLog.Entries))
{
tmpLog.AddEntry(entry);
}
float xp = KerbalRoster.CalculateExperience(pcm.careerLog);
float xp2 = KerbalRoster.CalculateExperience(tmpLog);
float amount = (xp2 - xp) * multiplier;
if (currency == Currency.Funds)
{
Funding.Instance.AddFunds(amount, TransactionReasons.Strategies);
}
else if (currency == Currency.Reputation)
{
Reputation.Instance.AddReputation(amount, TransactionReasons.Strategies);
}
else if (currency == Currency.Science)
{
ResearchAndDevelopment.Instance.AddScience(amount, TransactionReasons.Strategies);
}
CurrencyPopup.Instance.AddPopup(currency, amount, TransactionReasons.Strategies, Parent.Config.Title, false);
}
}
示例9: SpawnPassengers
public SpawnPassengers(List<string> passengerNames, int minPassengers, ProtoCrewMember.Gender? gender, ProtoCrewMember.KerbalType kerbalType, string experienceTrait)
{
this.passengerNames = passengerNames;
this.count = passengerNames.Count != 0 ? passengerNames.Count : minPassengers;
this.gender = gender;
this.kerbalType = kerbalType;
this.experienceTrait = experienceTrait;
}
示例10: TimeToStranded
public static int TimeToStranded(ProtoCrewMember Kerb) {
Vessel Vsl = GetVessel (Kerb);
if (Vsl != null) {
return TimeHelper.Days (TimeHelper.ToYears (2) - Vsl.missionTime);
}
return 0;
}
示例11: IrradiateKerbal
// Irradiates a kerbal
public void IrradiateKerbal(ProtoCrewMember crew, Vessel crewVessel, double pointAmount)
{
foreach (KeyValuePair<string,RadioactivityKerbal> kerbal in KerbalDB.Kerbals)
{
if (crew == kerbal.Value.Kerbal)
kerbal.Value.IrradiatePoint(crewVessel, pointAmount);
}
}
示例12: foreach
/* public void OnContractOffered(Contracts.Contract contract)
{
System.Type type = contract.GetType();
if (contract is FinePrint.Contracts.TourismContract);
{
}
foreach (var p in contract.AllParameters)
{
Debug.Log(p);
}
} */
public void ArchiveKerbal(ProtoCrewMember pcm)
{
Debug.Log("Archiving " + pcm.name);
pcm.type = ProtoCrewMember.KerbalType.Crew;
KerbalRoster.SetExperienceTrait(pcm);
CustomerRecord customer = new CustomerRecord(pcm);
customer.status = "ARCHIVED";
CustomerSave.ArchivedCustomers()[pcm.name] = customer;
}
示例13: BeginTask
public void BeginTask(ProtoCrewMember kerbal, double UT, string task,
string body, string situation)
{
if (!kerbal_experience.ContainsKey (kerbal.name)) {
AddKerbal (kerbal);
}
var exp = kerbal_experience[kerbal.name];
exp.BeginTask (UT, task, body, situation);
}
示例14: GetSeat
string GetSeat(ProtoCrewMember kerbal)
{
// Try to find the seat name
string seat = "";
if (kerbal.seat != null) {
seat = kerbal.seat.seatTransformName;
}
return seat;
}
示例15: KerbalModel
public KerbalModel(ProtoCrewMember kerbal, bool isNew)
{
this.Kerbal = kerbal;
Name = kerbal.name;
Stupidity = kerbal.stupidity;
Courage = kerbal.courage;
Badass = kerbal.isBadass;
IsNew = isNew;
}