OpenRA.Player.PlayerStanceColor C# (CSharp) Method

PlayerStanceColor() public method

public PlayerStanceColor ( OpenRA.Actor a ) : Color
a OpenRA.Actor
return System.Drawing.Color
        public Color PlayerStanceColor(Actor a)
        {
            var player = a.World.RenderPlayer ?? a.World.LocalPlayer;
            if (player != null && !player.Spectating)
            {
                var apparentOwner = a.EffectiveOwner != null && a.EffectiveOwner.Disguised
                    ? a.EffectiveOwner.Owner
                    : a.Owner;

                if (a.Owner.IsAlliedWith(a.World.RenderPlayer))
                    apparentOwner = a.Owner;

                if (apparentOwner == player)
                    return stanceColors.Self;

                if (apparentOwner.IsAlliedWith(player))
                    return stanceColors.Allies;

                if (!apparentOwner.NonCombatant)
                    return stanceColors.Enemies;
            }

            return stanceColors.Neutrals;
        }