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


C# IntVec3.GetThingList方法代码示例

本文整理汇总了C#中IntVec3.GetThingList方法的典型用法代码示例。如果您正苦于以下问题:C# IntVec3.GetThingList方法的具体用法?C# IntVec3.GetThingList怎么用?C# IntVec3.GetThingList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IntVec3的用法示例。


在下文中一共展示了IntVec3.GetThingList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DesignateSingleCell

 public override void DesignateSingleCell(IntVec3 c)
 {
     List<Thing> thingList = c.GetThingList();
     foreach (var thing in thingList)
         if (thing.def.category == ThingCategory.Item && !Find.Reservations.IsReserved(thing, Faction.OfColony))
             designations.Add(new Designation(thing, DesignationDefOf.Haul));
 }
开发者ID:BBream,项目名称:ToolsForHaul,代码行数:7,代码来源:Designator_PutInInventory.cs

示例2: AllowsPlacing

        public override AcceptanceReport AllowsPlacing( BuildableDef checkingDef, IntVec3 loc, Rot4 rot )
        {
            ThingDef def = checkingDef as ThingDef;

            var Restrictions = def.GetCompProperties( typeof( RestrictedPlacement_Comp ) ) as RestrictedPlacement_Properties;
            if( Restrictions == null ){
                Log.Error( "Could not get restrictions!" );
                return (AcceptanceReport)false;
            }

            // Override steam-geyser restriction
            if( ( Restrictions.RestrictedThing.FindIndex( r => r == ThingDefOf.SteamGeyser ) >= 0 )&&
                ( ThingDefOf.GeothermalGenerator != ( checkingDef as ThingDef ) ) ){
                var newGeo = checkingDef as ThingDef;
                ThingDefOf.GeothermalGenerator = newGeo;
            }

            foreach( Thing t in loc.GetThingList() ){
                if( ( Restrictions.RestrictedThing.Find( r => r == t.def ) != null )&&
                    ( t.Position == loc ) )
                    return (AcceptanceReport)true;
            }

            return "MessagePlacementNotHere".Translate();
        }
开发者ID:DAOWAce,项目名称:CommunityCoreLibrary,代码行数:25,代码来源:PlaceWorker_OnlyOnThing.cs

示例3: IsValidCellToWander

 protected bool IsValidCellToWander(IntVec3 cell)
 {
     if (cell.Standable() == false)
     {
         return false;
     }
     if (this.pawn.CanReach(new TargetInfo(cell), PathEndMode.OnCell, Danger.None) == false)
     {
         return false;
     }
     foreach (Thing thing in cell.GetThingList())
     {
         if (thing is Fire)
         {
             return false;
         }
     }
     if (cell.GetRoom() != this.TargetLocA.GetRoom())
     {
         return false;
     }
     if (Find.PawnDestinationManager.DestinationIsReserved(cell))
     {
         return false;
     }
     return true;
 }
开发者ID:Rikiki123456789,项目名称:Rimworld,代码行数:27,代码来源:JobDriver_Pyre.cs

示例4: CanDesignateCell

 public override AcceptanceReport CanDesignateCell(IntVec3 loc)
 {
     foreach (Thing thing in loc.GetThingList())
     {
         Pawn p = thing as Pawn;
         if (p == null || !GenAI.MachinesLike(turretGuns.First().parent.Faction, p))
             return true;
     }
     return new AcceptanceReport(txtCannotSetForcedTarget.Translate());
 }
开发者ID:BBream,项目名称:Vehicle,代码行数:10,代码来源:Designator_ForcedTarget.cs

示例5: AllowsPlacing

        public override AcceptanceReport AllowsPlacing( BuildableDef checkingDef, IntVec3 loc, Rot4 rot )
        {
            foreach( Thing curThing in loc.GetThingList() )
            {
                if( curThing.def.surfaceType != SurfaceType.None )
                {
                    return AcceptanceReport.WasAccepted;
                }
            }

            return (AcceptanceReport)( "MessagePlacementItemSurface".Translate() );
        }
开发者ID:Kiggerbare,项目名称:CommunityCoreLibrary,代码行数:12,代码来源:PlaceWorker_OnlyOnSurface.cs

示例6: CanDesignateCell

        public override AcceptanceReport CanDesignateCell(IntVec3 loc)
        {
            List<Thing> thingList = loc.GetThingList();

            foreach (var thing in thingList)
            {
                Pawn pawn = thing as Pawn;
                if (pawn != null && pawn.health.ShouldBeTreatedNow)
                    return true;
            }
            return new AcceptanceReport(txtNoNeedTreatment.Translate());
        }
开发者ID:BBream,项目名称:ToolsForHaul,代码行数:12,代码来源:Designator_ApplyMedicine.cs

示例7: CanDesignateCell

        public override AcceptanceReport CanDesignateCell(IntVec3 loc)
        {
            List<Thing> thingList = loc.GetThingList();

            foreach (var thing in thingList)
            {
                Pawn pawn = thing as Pawn;
                if (pawn != null && (pawn.Faction == Faction.OfColony || (pawn.RaceProps.Animal && pawn.drafter != null)))
                    return true;
            }
            return new AcceptanceReport(txtCannotBoard.Translate());
        }
开发者ID:BBream,项目名称:Vehicle,代码行数:12,代码来源:Designator_Board.cs

示例8: DesignateSingleCell

 public override void DesignateSingleCell(IntVec3 c)
 {
     foreach (Thing thing in c.GetThingList())
     {
         Pawn p = thing as Pawn;
         if (p == null || !GenAI.MachinesLike(turretGuns.First().parent.Faction, p))
         {
             foreach (Parts_TurretGun turretGun in turretGuns)
                 turretGun.OrderAttack(thing);
             break;
         }
     }
     DesignatorManager.Deselect();
 }
开发者ID:BBream,项目名称:Vehicle,代码行数:14,代码来源:Designator_ForcedTarget.cs

示例9: CanDesignateCell

 public override AcceptanceReport CanDesignateCell(IntVec3 loc)
 {
     Pawn pawn = loc.GetThingList().Find(t => t is Pawn) as Pawn;
     if (pawn == null)
         return new AcceptanceReport(txtCannotMount.Translate() + ": " + "NotPawn".Translate());
     if (pawn.Faction != Faction.OfColony)
         return new AcceptanceReport(txtCannotMount.Translate() + ": " + "NotColonyFaction".Translate());
     if (!pawn.RaceProps.Animal && vehicle is Vehicle_Saddle)
         return new AcceptanceReport(txtCannotMount.Translate() + ": " + "NotHumanlikeOrMechanoid".Translate());
     if (pawn.RaceProps.Animal && !pawn.training.IsCompleted(TrainableDefOf.Obedience))
         return new AcceptanceReport(txtCannotMount.Translate() + ": " + "NotTrainedAnimal".Translate());
     if (pawn.RaceProps.Animal && !(pawn.RaceProps.baseBodySize >= 1.0))
         return new AcceptanceReport(txtCannotMount.Translate() + ": " + "TooSmallAnimal".Translate());
     return true;
 }
开发者ID:BBream,项目名称:ToolsForHaul,代码行数:15,代码来源:Designator_Mount.cs

示例10: AllowsPlacing

        public override AcceptanceReport AllowsPlacing( BuildableDef checkingDef, IntVec3 loc, Rot4 rot )
        {
            ThingDef def = checkingDef as ThingDef;

            var Restrictions = def.GetCompProperties( typeof( RestrictedPlacement_Comp ) ) as RestrictedPlacement_Properties;
            if( Restrictions == null ){
                Log.Error( "Could not get restrictions!" );
                return false;
            }

            foreach( Thing t in loc.GetThingList() )
                if( Restrictions.RestrictedThing.Find( r => r == t.def ) != null )
                    return "MessagePlacementNotOn".Translate() + t.def.label;

            return true;
        }
开发者ID:DAOWAce,项目名称:CommunityCoreLibrary,代码行数:16,代码来源:PlaceWorker_NotOnThing.cs

示例11: DesignateSingleCell

 public override void DesignateSingleCell(IntVec3 c)
 {
     List<Thing> thingList = c.GetThingList();
     foreach (var thing in thingList)
     {
         Pawn pawn = thing as Pawn;
         if (pawn != null && pawn.health.ShouldBeTreatedNow)
         {
             Job jobNew = new Job(DefDatabase<JobDef>.GetNamed("ApplyMedicine"));
             jobNew.targetA = pawn;
             jobNew.targetB = medicine;
             jobNew.maxNumToCarry = Medicine.GetMedicineCountToFullyHeal(jobNew.targetA.Thing as Pawn);
             doctor.drafter.TakeOrderedJob(jobNew);
             break;
         }
     }
     DesignatorManager.Deselect();
 }
开发者ID:BBream,项目名称:ToolsForHaul,代码行数:18,代码来源:Designator_ApplyMedicine.cs

示例12: DesignateSingleCell

 public override void DesignateSingleCell(IntVec3 c)
 {
     List<Thing> thingList = c.GetThingList();
     foreach (var thing in thingList)
     {
         Pawn pawn = thing as Pawn;
         if (pawn != null && (pawn.Faction == Faction.OfColony && (pawn.RaceProps.mechanoid || pawn.RaceProps.Humanlike)))
         {
             Pawn crew = pawn;
             Job jobNew = new Job(DefDatabase<JobDef>.GetNamed("Board"));
             Find.Reservations.ReleaseAllForTarget(vehicle);
             jobNew.targetA = vehicle;
             crew.drafter.TakeOrderedJob(jobNew);
             break;
         }
     }
     DesignatorManager.Deselect();
 }
开发者ID:BBream,项目名称:ToolsForHaul,代码行数:18,代码来源:Designator_Board.cs

示例13: DesignateSingleCell

 public override void DesignateSingleCell(IntVec3 c)
 {
     List<Thing> thingList = c.GetThingList();
     foreach (var thing in thingList)
     {
         Pawn pawn = thing as Pawn;
         if (pawn != null && (pawn.Faction == Faction.OfColony || (pawn.RaceProps.Animal && pawn.drafter != null)))
         {
             Pawn driver = pawn;
             Job jobNew = new Job(DefDatabase<JobDef>.GetNamed("Mount"));
             Find.Reservations.ReleaseAllForTarget(vehicle);
             jobNew.targetA = vehicle;
             jobNew.targetB = mountPos;
             driver.drafter.TakeOrderedJob(jobNew);
             break;
         }
     }
     DesignatorManager.Deselect();
 }
开发者ID:BBream,项目名称:Vehicle,代码行数:19,代码来源:Designator_Mount.cs

示例14: AllowsPlacing

        public override AcceptanceReport AllowsPlacing( BuildableDef checkingDef, IntVec3 loc, Rot4 rot )
        {
            var Restrictions = checkingDef.RestrictedPlacement_Properties();
            #if DEBUG
            if( Restrictions == null )
            {
                CCL_Log.Error( "PlaceWorker_OnlyOnThing unable to get properties!", checkingDef.defName );
                return AcceptanceReport.WasRejected;
            }
            #endif

            var thingDef = checkingDef as ThingDef;
            #if DEBUG
            if( thingDef == null )
            {
                CCL_Log.Error( "PlaceWorker_OnlyOnTerrain unable to cast BuildableDef to ThingDef!", checkingDef.defName );
                return AcceptanceReport.WasRejected;
            }
            #endif

            // Override steam-geyser restriction if required
            if(
                ( Restrictions.RestrictedThing.Exists( r => r == ThingDefOf.SteamGeyser ) )&&
                ( ThingDefOf.GeothermalGenerator != thingDef )
            )
            {
                ThingDefOf.GeothermalGenerator = thingDef;
            }

            foreach( Thing t in loc.GetThingList() )
            {
                if(
                    ( Restrictions.RestrictedThing.Find( r => r == t.def ) != null )&&
                    ( t.Position == loc )
                )
                {
                    return AcceptanceReport.WasAccepted;
                }
            }

            return (AcceptanceReport)( "MessagePlacementNotHere".Translate() );
        }
开发者ID:Kiggerbare,项目名称:CommunityCoreLibrary,代码行数:42,代码来源:PlaceWorker_OnlyOnThing.cs

示例15: AllowsPlacing

 public override AcceptanceReport AllowsPlacing(BuildableDef checkingDef, IntVec3 loc, Rot4 rot)
 {
     List<Thing> thingList = loc.GetThingList();
     for (int i = 0; i < thingList.Count; i++)
     {
         if (thingList[i].def.EverTransmitsGas())
         {
             return AcceptanceReport.WasRejected;
         }
         if (thingList[i].def.entityDefToBuild != null)
         {
             ThingDef entityDefToBuild = thingList[i].def.entityDefToBuild as ThingDef;
             if ((entityDefToBuild != null) && entityDefToBuild.EverTransmitsGas())
             {
                 return AcceptanceReport.WasRejected;
             }
         }
     }
     return AcceptanceReport.WasAccepted;
 }
开发者ID:isistoy,项目名称:DevLib,代码行数:20,代码来源:PlaceWorker_Pipe.cs


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