本文整理汇总了C#中Pawn.CurrentBed方法的典型用法代码示例。如果您正苦于以下问题:C# Pawn.CurrentBed方法的具体用法?C# Pawn.CurrentBed怎么用?C# Pawn.CurrentBed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pawn
的用法示例。
在下文中一共展示了Pawn.CurrentBed方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetFloatMenuOptions
public override IEnumerable<FloatMenuOption> GetFloatMenuOptions(Pawn myPawn)
{
List<FloatMenuOption> list = new List<FloatMenuOption>();
{
if (!myPawn.CanReserve(this, 1))
{
FloatMenuOption item = new FloatMenuOption("CannotUseReserved", null);
return new List<FloatMenuOption>
{
item
};
}
if (!myPawn.CanReach(this, PathEndMode.Touch, Danger.Some))
{
FloatMenuOption item2 = new FloatMenuOption("CannotUseNoPath", null);
return new List<FloatMenuOption>
{
item2
};
}
Action action1 = delegate
{
Job job = new Job(JobDefOf.Goto, this);
myPawn.QueueJob(job);
myPawn.jobs.StopAll();
MainDealer = myPawn;
ActiveUse = true;
};
list.Add(new FloatMenuOption("Use Pills", action1));
Action action = delegate
{
Job job = new Job(DefDatabase<JobDef>.GetNamed("ClutterGoAndPickUpItem", true), this, this.Position);
Job job1 = new Job(DefDatabase<JobDef>.GetNamed("JobDriver_SleepPills", true), this, myPawn.CurrentBed());
myPawn.QueueJob(job);
myPawn.QueueJob(job1);
MainDealer = myPawn;
ActivePickUp = true;
};
list.Add(new FloatMenuOption("Pick Up", action));
if (this.stackCount > 1)
{
Action action3 = delegate
{
Job job = new Job(DefDatabase<JobDef>.GetNamed("ClutterGoAndPickUpItem", true), this, this.Position);
myPawn.QueueJob(job);
myPawn.jobs.StopAll();
MainDealer = myPawn;
ActivePickOne = true;
ActivePickUp = true;
};
list.Add(new FloatMenuOption("Pick Up One Pill", action3));
}
}
return list;
}
示例2: RoomStateForPawn
private LockState RoomStateForPawn( Room room, Pawn pawn )
{
if(
( !room.Owners.Contains( pawn ) )||
( pawn.needs.food.CurCategory >= HungerCategory.UrgentlyHungry )||
( pawn.needs.joy.CurCategory <= JoyCategory.Low )
)
{ // Pawn doesn't own this room, or;
// Needs food, or;
// Needs joy
// don't lock them in
return LockState.WantUnlock;
}
foreach( var owner in room.Owners )
{
if( owner.GetRoom() != room )
{ // Not all the owners are in the room
// Don't lock them out
return LockState.WantUnlock;
}
}
if(
( pawn.CurrentBed() != null )&&
( !HealthUtility.PawnShouldGetImmediateTending( pawn ) )
)
{
// In bed,
// Not needing doctors care,
return LockState.WantLock;
}
if(
( pawn.CurJob != null )&&
( pawn.CurJob.def.driverClass == typeof( JobDriver_RelaxAlone ) )
)
{
// Doing something that want's privacy
return LockState.WantLock;
}
// Pawn is awake and not doing anything they want privacy for
return LockState.WantUnlock;
}