当前位置: 首页>>代码示例>>C#>>正文


C# Pawn.QueueJob方法代码示例

本文整理汇总了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;
        }
开发者ID:isistoy,项目名称:DevLib,代码行数:65,代码来源:Drugs.cs

示例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
                    {
//.........这里部分代码省略.........
开发者ID:isistoy,项目名称:DevLib,代码行数:101,代码来源:Lamps.cs


注:本文中的Pawn.QueueJob方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。