本文整理汇总了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));
}
示例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();
}
示例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;
}
示例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());
}
示例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() );
}
示例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());
}
示例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());
}
示例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();
}
示例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;
}
示例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;
}
示例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();
}
示例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();
}
示例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();
}
示例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() );
}
示例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;
}