本文整理汇总了C#中IntVec3.Walkable方法的典型用法代码示例。如果您正苦于以下问题:C# IntVec3.Walkable方法的具体用法?C# IntVec3.Walkable怎么用?C# IntVec3.Walkable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IntVec3
的用法示例。
在下文中一共展示了IntVec3.Walkable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: CanSpawnMechanoidAt
private bool CanSpawnMechanoidAt(IntVec3 c)
{
return c.Walkable();
}
示例3: 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;
}