本文整理汇总了C#中Pawn.QueueJob方法的典型用法代码示例。如果您正苦于以下问题:C# Pawn.QueueJob方法的具体用法?C# Pawn.QueueJob怎么用?C# Pawn.QueueJob使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pawn
的用法示例。
在下文中一共展示了Pawn.QueueJob方法的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: 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
};
}
if (Find.MapConditionManager.ConditionIsActive(MapConditionDefOf.SolarFlare))
{
FloatMenuOption item3 = new FloatMenuOption("CannotUseSolarFlare".Translate(), null);
return new List<FloatMenuOption>
{
item3
};
}
if (!this.powerComp.PowerOn)
{
FloatMenuOption item4 = new FloatMenuOption("CannotUseNoPower".Translate(), null);
return new List<FloatMenuOption>
{
item4
};
}
if (!Find.ResearchManager.IsFinished(ResearchProjectDef.Named("ColoredLights")))
{
FloatMenuOption item5 = new FloatMenuOption("NeedsResearch".Translate(), null);
return new List<FloatMenuOption>
{
item5
};
}
if (!YellowLight)
{
Action action1 = delegate
{
Job job = new Job(JobDefOf.Goto, this);
myPawn.QueueJob(job);
myPawn.jobs.StopAll();
LampNumber = 1;
pawn = myPawn; ;
jobPawn = job;
};
list.Add(new FloatMenuOption("Yellow Light", action1));
}
if (!BlueLight)
{
Action action2 = delegate
{
Job job = new Job(JobDefOf.Goto, this);
myPawn.QueueJob(job);
myPawn.jobs.StopAll();
LampNumber = 2;
pawn = myPawn;
jobPawn = job;
};
list.Add(new FloatMenuOption("Blue Light", action2));
}
if (!RedLight)
{
Action action3 = delegate
{
Job job = new Job(JobDefOf.Goto, this);
myPawn.QueueJob(job);
myPawn.jobs.StopAll();
LampNumber = 3;
pawn = myPawn;
jobPawn = job;
};
list.Add(new FloatMenuOption("Red Light", action3));
}
if (!GreenLight)
{
Action action4 = delegate
{
//.........这里部分代码省略.........