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


C# IntVec3.InBounds方法代码示例

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


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

示例1: ShouldLinkWith

        public override bool ShouldLinkWith( IntVec3 c, Thing parent )
        {
            var compAir = parent.TryGetComp< CompAir >();
            if ( compAir == null )
                return false;

            var lowerFlag = AirNetGrid.NetAt( c, NetLayer.Lower ) != null && compAir.IsLayerOf( NetLayer.Lower );
            var upperFlag = AirNetGrid.NetAt( c, NetLayer.Upper ) != null && compAir.IsLayerOf( NetLayer.Upper );

            return c.InBounds() && (lowerFlag || upperFlag);
        }
开发者ID:ForsakenShell,项目名称:RimWorld-RedistHeat,代码行数:11,代码来源:Graphic_LinkedAirPipe.cs

示例2: CanDesignateCell

 public override AcceptanceReport CanDesignateCell( IntVec3 c )
 {
     if (!c.InBounds())
     {
         return false;
     }
     if (!Game.GodMode && c.Fogged())
     {
         return false;
     }
     return TopDeconstructibleInCell( c ) != null;
 }
开发者ID:ChaosTherum,项目名称:RimWorld-RedistHeat,代码行数:12,代码来源:Designator_DeconstructReversed.cs

示例3: CanDesignateCell

 public override AcceptanceReport CanDesignateCell(IntVec3 c)
 {
     if (!c.InBounds())
     {
         return false;
     }
     if (CryptoAnimalsInCell(c).Count() == 0)
     {
         return "Must designate animal of faction";
     }
     return true;
 }
开发者ID:FluffierThanThou,项目名称:RW_NoColonistLeftBehind,代码行数:12,代码来源:Designator_PutInCrypto.cs

示例4: CanDesignateCell

 public override AcceptanceReport CanDesignateCell( IntVec3 c )
 {
     if( !c.InBounds() )
         return "OutOfBounds".Translate();
     if( c.Fogged() )
         return "CannotPlaceInUndiscovered".Translate();
     if( Find.DesignationManager.DesignationAt( c, DesignationDefOf.Mine ) != null )
         return "SpaceAlreadyOccupied".Translate();
     Thing mineable = MineUtility.MineableInCell( c );
     if( ( mineable == null )||( !mineable.def.building.isResourceRock ) )
         return "MessageMustDesignateMineable".Translate();
     return AcceptanceReport.WasAccepted;
 }
开发者ID:isistoy,项目名称:Es-Small-Mods,代码行数:13,代码来源:Designator_MineVein.cs

示例5: IsValidPositionToSpawnRefugeePod

 public static bool IsValidPositionToSpawnRefugeePod(IntVec3 position)
 {
     ThingDef chunkDef = ThingDefOf.ShipChunk;
     if ((position.InBounds() == false)
         || position.Fogged()
         || (position.Standable() == false)
         || (position.Roofed()
             && position.GetRoof().isThickRoof))
     {
         return false;
     }
     return true;
 }
开发者ID:Rikiki123456789,项目名称:Rimworld,代码行数:13,代码来源:IncidentWorker_RefugeePodCrashInCaveInCave.cs

示例6: CanDesignateCell

        // returning string text assigning false reason to AcceptanceReport
        public override AcceptanceReport CanDesignateCell(IntVec3 cell)
        {
            if (!cell.InBounds() || cell.Fogged() || cell.ContainsStaticFire())
            {
                return false;
            }

            var firstItem = cell.GetFirstItem();
            if (firstItem != null && CanDesignateThing(firstItem).Accepted)
            {
                return true;
            }

            return false;
        }
开发者ID:RWA-Team,项目名称:RimworldAscension,代码行数:16,代码来源:Designator_PutInSlot.cs

示例7: CanDesignateCell

 public override AcceptanceReport CanDesignateCell(IntVec3 c)
 {
     if (c.InBounds()
         && (c.Fogged() == false))
     {
         Area outpostArea = OG_Util.FindOutpostArea();
         if ((outpostArea != null)
             && outpostArea.ActiveCells.Contains(c))
         {
             return "You cannot manage MiningCo. Outpost roof. This area does not belong to your colony.";
         }
         if (Find.RoofGrid.RoofAt(c) == OG_Util.IronedRoofDef)
         {
             return true;
         }
     }
     return base.CanDesignateCell(c);
 }
开发者ID:Rikiki123456789,项目名称:Rimworld,代码行数:18,代码来源:Designator_AreaNoRoofClearOutpost.cs

示例8: CanDesignateCell

 // returning string text assigning false reason to AcceptanceReport
 public override AcceptanceReport CanDesignateCell(IntVec3 loc)
 {
     if (!loc.InBounds())
     {
         return false;
     }
     if (loc.Fogged())
     {
         return false;
     }
     if (Find.DesignationManager.DesignationAt(loc, designationDef) != null)
     {
         return false;
     }
     if (!allowedTerrain.Contains(Find.TerrainGrid.TerrainAt(loc)))
     {
         return "Wrong terrain type";
     }
     return AcceptanceReport.WasAccepted;
 }
开发者ID:RWA-Team,项目名称:RimworldAscension,代码行数:21,代码来源:Designator_Collect.cs

示例9: CanDesignateCell

 public override AcceptanceReport CanDesignateCell( IntVec3 c )
 {
     if( !c.InBounds() )
         return "OutOfBounds".Translate();
     if( c.Fogged() )
         return "CannotPlaceInUndiscovered".Translate();
     if( Find.DesignationManager.DesignationAt( c, SmoothWall.designationDef ) != null )
         return "TerrainBeingSmoothed".Translate();
     // Must be mineable
     Thing mineable = MineUtility.MineableInCell( c );
     if( mineable == null )
     {
         return "MessageMustDesignateMineable".Translate();
     }
     // Must have associated stone blocks
     string blocksDef = "Blocks" + mineable.def.defName;
     ThingDef stoneBlocks = DefDatabase<ThingDef>.GetNamed( blocksDef, false );
     if( stoneBlocks == null )
     {
         return "MessageMustDesignateMineable".Translate();
     }
     return AcceptanceReport.WasAccepted;
 }
开发者ID:ForsakenShell,项目名称:Es-Small-Mods,代码行数:23,代码来源:Designator_SmoothWall.cs

示例10: FindHopperUser

        public static Thing FindHopperUser( IntVec3 cell )
        {
            if( !cell.InBounds() )
            {
                // Out of bounds
                return null;
            }
            var thingList = cell.GetThingList();
            foreach( var thing in thingList )
            {
                var thingDef = GenSpawn.BuiltDefOf( thing.def ) as ThingDef;
                if(
                    ( thingDef != null )&&
                    ( thingDef.IsHopperUser() )
                )
                {
                    // This thing wants a hopper
                    return thing;
                }
            }

            // Nothing found
            return null;
        }
开发者ID:Kiggerbare,项目名称:CommunityCoreLibrary,代码行数:24,代码来源:CompHopper.cs

示例11: AlignQualityAgainst

    private static int AlignQualityAgainst( IntVec3 sq )
    {
        if( !sq.InBounds() )
            return 0;

        //We align against anything unwalkthroughable and against blueprints for unwalkthroughable things
        if( !sq.Walkable() )
            return 9;

        List<Thing> things = Find.ThingGrid.ThingsListAt(sq);
        for(int i=0; i<things.Count; i++ )
        {
            Thing t = things[i];

            if( t.def.eType == EntityType.Door )
                return 1;

            Thing blue = t as Blueprint;
            if( blue != null )
            {
                if( blue.def.entityDefToBuild.passability == Traversability.Impassable )
                    return 9;
                if( blue.def.eType == EntityType.Door )
                    return 1;
            }
        }

        return 0;
    }
开发者ID:raimis001,项目名称:raWorld,代码行数:29,代码来源:Building_Door.cs

示例12: ProtectSquare

 private void ProtectSquare(IntVec3 square)
 {
     if (!square.InBounds())
     {
         return;
     }
     List<Thing> list = Find.ThingGrid.ThingsListAt(square);
     List<Thing> list2 = new List<Thing>();
     int i = 0;
     int num = list.Count<Thing>();
     while (i < num)
     {
         if (list[i] != null && list[i] is Projectile)
         {
             Projectile projectile = (Projectile)list[i];
             if (!projectile.Destroyed)
             {
                 bool flag = true;
                 if (flag)
                 {
                     Quaternion exactRotation = projectile.ExactRotation;
                     Vector3 exactPosition = projectile.ExactPosition;
                     exactPosition.y = 0f;
                     Vector3 b = Vectors.IntVecToVec(this.Position);
                     b.y = 0f;
                     Quaternion b2 = Quaternion.LookRotation(exactPosition - b);
                     if (Quaternion.Angle(exactRotation, b2) > 90f)
                     {
                         MoteThrower.ThrowLightningGlow(projectile.ExactPosition, 0.5f);
                         Building_DefenceShield.SoundAbsorbDamage.PlayOneShot(projectile.Position);
                         int damageAmountBase = projectile.def.projectile.damageAmountBase;
                         BodyPartDamageInfo value = new BodyPartDamageInfo(null, null);
                         DamageInfo dinfo = new DamageInfo(projectile.def.projectile.damageDef, damageAmountBase, projectile, projectile.ExactRotation.eulerAngles.y, new BodyPartDamageInfo?(value), null);
                         this.AbsorbedDamage(dinfo);
                         list2.Add(projectile);
                         if (!this.ShouldDisplay)
                         {
                             break;
                         }
                     }
                 }
             }
         }
         i++;
     }
     foreach (Thing current in list2)
     {
         current.Destroy(DestroyMode.Vanish);
     }
 }
开发者ID:Skullywag,项目名称:DefenceShield,代码行数:50,代码来源:Building_OmniShield.cs

示例13: FindHopper

 public static CompHopper FindHopper( IntVec3 cell )
 {
     //var str = string.Format( "CompHopperUser.FindHopper( {0} )", cell.ToString() );
     if( !cell.InBounds() )
     {
         //Log.Message( str );
         return null;
     }
     List<Thing> thingList = null;
     if( Scribe.mode != LoadSaveMode.Inactive )
     {   // Find hopper in world matching cell
         if(
             ( Find.ThingGrid == null )||
             ( Find.ThingGrid.ThingsAt( cell ).Count() == 0 )
         )
         {
             //Log.Message( str );
             return null;
         }
         thingList = Find.ThingGrid.ThingsAt( cell ).ToList();
     }
     else
     {   // Find hopper in cell
         thingList = cell.GetThingList();
     }
     if( !thingList.NullOrEmpty() )
     {
         var hopper = thingList.FirstOrDefault( (thing) =>
         {
             var thingDef = GenConstruct.BuiltDefOf( thing.def ) as ThingDef;
             return ( thingDef != null )&&( thingDef.IsHopper() );
         } );
         if( hopper != null )
         {   // Found a hopper
             //str += " = " + hopper.ThingID;
             //Log.Message( str );
             return hopper.TryGetComp<CompHopper>();
         }
     }
     // No hopper found
     //Log.Message( str );
     return null;
 }
开发者ID:RawCode,项目名称:CommunityCoreLibrary,代码行数:43,代码来源:CompHopperUser.cs

示例14: AllowsPlacing

 public override AcceptanceReport AllowsPlacing( BuildableDef def, IntVec3 center, Rot4 rot )
 {
     return center.InBounds();
 }
开发者ID:ForsakenShell,项目名称:RimWorld-RedistHeat,代码行数:4,代码来源:PlaceWorker_DuctCooler.cs

示例15: ShouldLinkWith

 public override bool ShouldLinkWith(IntVec3 c, Thing parent)
 {
     if (!c.InBounds())
         return false;
     return GasNetGrid.TransmittedGasNetAt(c) != null;
 }
开发者ID:isistoy,项目名称:DevLib,代码行数:6,代码来源:GasNetGraphics.cs


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