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


C# IntVec3.GetRoom方法代码示例

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


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

示例1: 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

示例2: AllowsPlacing

 public override AcceptanceReport AllowsPlacing(BuildableDef checkingDef, IntVec3 loc, Rot4 rot)
 {
     var room = loc.GetRoom();
     if( room.ContainedBeds.Any( bed => !bed.ForPrisoners ) )
     {
         return (AcceptanceReport) Data.Strings.NoColonistBeds.Translate();
     }
     return (AcceptanceReport) true;
 }
开发者ID:ForsakenShell,项目名称:Es-Small-Mods,代码行数:9,代码来源:PlaceWorker_PrisonMarker.cs

示例3: DrawGhost

        public override void DrawGhost( ThingDef def, IntVec3 center, Rot4 rot )
        {
            base.DrawGhost( def, center, rot );

            var room = center.GetRoom();
            if ( room == null || room.UsesOutdoorTemperature )
            {
                return;
            }
            GenDraw.DrawFieldEdges( room.Cells.ToList(), GenTemperature.ColorRoomHot );
        }
开发者ID:ForsakenShell,项目名称:RimWorld-RedistHeat,代码行数:11,代码来源:PlaceWorker_DuctCooler.cs

示例4: PlaceSpotQualityAt

        // overhauled version (vanilla is bugged)
        public static PlaceSpotQuality PlaceSpotQualityAt(IntVec3 c, Thing thing, IntVec3 center)
        {
            if (!c.InBounds() || !c.Walkable())
            {
                return PlaceSpotQuality.Unusable;
            }

            List<Thing> list = Find.ThingGrid.ThingsListAt(c);

            // if other things on cell
            int i = 0;
            while (i < list.Count)
            {
                Thing thing2 = list[i];
                if (thing.def.saveCompressible && thing2.def.saveCompressible)
                {
                    return PlaceSpotQuality.Unusable;
                }
                // same thing type
                if (thing2.def.category == ThingCategory.Item)
                {
                    // can stack with
                    if (thing2.def == thing.def && thing2.stackCount < thing.def.stackLimit)
                    {
                        // can absorb
                        // Required, because thing reference is changed to the absorber, if absorbed
                        Thing t = thing2;
                        if (thing.TryAbsorbStack(thing2, true))
                        {
                            // Clean up to prevent haulables lists overflow
                            RemoveHaulableFromLists(t);
                            return PlaceSpotQuality.Perfect;
                        }
                        // cannot absorb all/anything
                        else
                            return PlaceSpotQuality.Unusable;
                    }
                    return PlaceSpotQuality.Unusable;
                }
                else
                {
                    i++;
                }
            }
            // if in same room
            if (c.GetRoom() == center.GetRoom())
            {
                PlaceSpotQuality placeSpotQuality = PlaceSpotQuality.Perfect;
                for (int j = 0; j < list.Count; j++)
                {
                    Thing thing3 = list[j];
                    if (thing3.def.thingClass == typeof(Building_Door))
                    {
                        return PlaceSpotQuality.Bad;
                    }
                    Pawn pawn = thing3 as Pawn;
                    if (pawn != null)
                    {
                        if (pawn.Downed)
                        {
                            return PlaceSpotQuality.Bad;
                        }
                        if (placeSpotQuality > PlaceSpotQuality.Okay)
                        {
                            placeSpotQuality = PlaceSpotQuality.Okay;
                        }
                    }
                    if (thing3.def.category == ThingCategory.Plant && thing3.def.selectable && placeSpotQuality > PlaceSpotQuality.Okay)
                    {
                        placeSpotQuality = PlaceSpotQuality.Okay;
                    }
                }
                return placeSpotQuality;
            }
            if (!center.CanReach(c, PathEndMode.OnCell, TraverseMode.PassDoors, Danger.Deadly))
            {
                return PlaceSpotQuality.Awful;
            }
            return PlaceSpotQuality.Okay;
        }
开发者ID:Wivex,项目名称:ContainersForStuff,代码行数:81,代码来源:JobDriver_HaulToCell.cs

示例5: GetPartyAreaCells

 protected static List<IntVec3> GetPartyAreaCells(IntVec3 pyrePosition)
 {
     IEnumerable<IntVec3> cellsInRange = GenRadial.RadialCellsAround(pyrePosition, partyAreaRadius, true);
     List<IntVec3> partyAreaCells = new List<IntVec3>();
     foreach (IntVec3 cell in cellsInRange)
     {
         if (cell.GetRoom() == pyrePosition.GetRoom())
         {
             partyAreaCells.Add(cell);
         }
     }
     return partyAreaCells;
 }
开发者ID:Rikiki123456789,项目名称:Rimworld,代码行数:13,代码来源:Building_Pyre.cs

示例6: GetEffectZoneCells

 /// <summary>
 /// Get the effect zone cells.
 /// </summary>
 public static List<IntVec3> GetEffectZoneCells(IntVec3 alertSpeakerPosition)
 {
     IEnumerable<IntVec3> cellsInRange = GenRadial.RadialCellsAround(alertSpeakerPosition, Building_AlertSpeaker.alertSpeakerMaxRange, true);
     List<IntVec3> effectZoneCells = new List<IntVec3>();
     foreach (IntVec3 cell in cellsInRange)
     {
         if (cell.GetRoom() == alertSpeakerPosition.GetRoom())
         {
             effectZoneCells.Add(cell);
         }
     }
     return effectZoneCells;
 }
开发者ID:Rikiki123456789,项目名称:Rimworld,代码行数:16,代码来源:Building_AlertSpeaker.cs


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