Rename Stance to PlayerRelationship

This commit is contained in:
abcdefg30
2020-09-25 16:22:37 +02:00
committed by Paul Chote
parent 672172d1f1
commit eda9966d27
63 changed files with 111 additions and 111 deletions

View File

@@ -294,7 +294,7 @@ namespace OpenRA.Mods.Common.Traits
{
// If we can't attack right now, there's no need to try and find a target.
var attackStances = ab.UnforcedAttackTargetStances();
if (attackStances != OpenRA.Traits.Stance.None)
if (attackStances != OpenRA.Traits.PlayerRelationship.None)
{
var range = Info.ScanRadius > 0 ? WDist.FromCells(Info.ScanRadius) : ab.GetMaximumRange();
return ChooseTarget(self, ab, attackStances, range, allowMove, allowTurn);
@@ -337,7 +337,7 @@ namespace OpenRA.Mods.Common.Traits
});
}
Target ChooseTarget(Actor self, AttackBase ab, Stance attackStances, WDist scanRange, bool allowMove, bool allowTurn)
Target ChooseTarget(Actor self, AttackBase ab, PlayerRelationship attackStances, WDist scanRange, bool allowMove, bool allowTurn)
{
var chosenTarget = Target.Invalid;
var chosenTargetPriority = int.MinValue;
@@ -362,7 +362,7 @@ namespace OpenRA.Mods.Common.Traits
// can bail early and avoid the more expensive targeting checks and armament selection. For groups of
// allied units, this helps significantly reduce the cost of auto target scans. This is important as
// these groups will continuously rescan their allies until an enemy finally comes into range.
if (attackStances == OpenRA.Traits.Stance.Enemy && !target.Actor.AppearsHostileTo(self))
if (attackStances == OpenRA.Traits.PlayerRelationship.Enemy && !target.Actor.AppearsHostileTo(self))
continue;
// Check whether we can auto-target this actor
@@ -375,7 +375,7 @@ namespace OpenRA.Mods.Common.Traits
}
else if (target.Type == TargetType.FrozenActor)
{
if (attackStances == OpenRA.Traits.Stance.Enemy && self.Owner.Stances[target.FrozenActor.Owner] == OpenRA.Traits.Stance.Ally)
if (attackStances == OpenRA.Traits.PlayerRelationship.Enemy && self.Owner.Stances[target.FrozenActor.Owner] == OpenRA.Traits.PlayerRelationship.Ally)
continue;
targetTypes = target.FrozenActor.TargetTypes;