Mop up remaining "race" private variables
This commit is contained in:
@@ -130,7 +130,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly string race;
|
readonly string faction;
|
||||||
readonly RenderSpritesInfo info;
|
readonly RenderSpritesInfo info;
|
||||||
readonly List<AnimationWrapper> anims = new List<AnimationWrapper>();
|
readonly List<AnimationWrapper> anims = new List<AnimationWrapper>();
|
||||||
string cachedImage;
|
string cachedImage;
|
||||||
@@ -145,7 +145,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
public RenderSprites(ActorInitializer init, RenderSpritesInfo info)
|
public RenderSprites(ActorInitializer init, RenderSpritesInfo info)
|
||||||
{
|
{
|
||||||
this.info = info;
|
this.info = info;
|
||||||
race = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName;
|
faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetImage(Actor self)
|
public string GetImage(Actor self)
|
||||||
@@ -153,7 +153,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (cachedImage != null)
|
if (cachedImage != null)
|
||||||
return cachedImage;
|
return cachedImage;
|
||||||
|
|
||||||
return cachedImage = info.GetImage(self.Info, self.World.Map.SequenceProvider, race);
|
return cachedImage = info.GetImage(self.Info, self.World.Map.SequenceProvider, faction);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdatePalette()
|
public void UpdatePalette()
|
||||||
|
|||||||
@@ -28,13 +28,13 @@ namespace OpenRA.Mods.RA.Traits
|
|||||||
{
|
{
|
||||||
readonly ClonesProducedUnitsInfo info;
|
readonly ClonesProducedUnitsInfo info;
|
||||||
readonly Production production;
|
readonly Production production;
|
||||||
readonly string race;
|
readonly string faction;
|
||||||
|
|
||||||
public ClonesProducedUnits(ActorInitializer init, ClonesProducedUnitsInfo info)
|
public ClonesProducedUnits(ActorInitializer init, ClonesProducedUnitsInfo info)
|
||||||
{
|
{
|
||||||
this.info = info;
|
this.info = info;
|
||||||
production = init.Self.Trait<Production>();
|
production = init.Self.Trait<Production>();
|
||||||
race = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName;
|
faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UnitProducedByOther(Actor self, Actor producer, Actor produced)
|
public void UnitProducedByOther(Actor self, Actor producer, Actor produced)
|
||||||
@@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA.Traits
|
|||||||
if (ci == null || !info.CloneableTypes.Intersect(ci.Types).Any())
|
if (ci == null || !info.CloneableTypes.Intersect(ci.Types).Any())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
production.Produce(self, produced.Info, race);
|
production.Produce(self, produced.Info, faction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,13 +51,13 @@ namespace OpenRA.Mods.RA.Traits
|
|||||||
public class SpawnActorOnDeath : INotifyKilled
|
public class SpawnActorOnDeath : INotifyKilled
|
||||||
{
|
{
|
||||||
readonly SpawnActorOnDeathInfo info;
|
readonly SpawnActorOnDeathInfo info;
|
||||||
readonly string race;
|
readonly string faction;
|
||||||
|
|
||||||
public SpawnActorOnDeath(ActorInitializer init, SpawnActorOnDeathInfo info)
|
public SpawnActorOnDeath(ActorInitializer init, SpawnActorOnDeathInfo info)
|
||||||
{
|
{
|
||||||
this.info = info;
|
this.info = info;
|
||||||
|
|
||||||
race = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName;
|
faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Killed(Actor self, AttackInfo e)
|
public void Killed(Actor self, AttackInfo e)
|
||||||
@@ -82,7 +82,7 @@ namespace OpenRA.Mods.RA.Traits
|
|||||||
new ParentActorInit(self),
|
new ParentActorInit(self),
|
||||||
new LocationInit(self.Location),
|
new LocationInit(self.Location),
|
||||||
new CenterPositionInit(self.CenterPosition),
|
new CenterPositionInit(self.CenterPosition),
|
||||||
new FactionInit(race)
|
new FactionInit(faction)
|
||||||
};
|
};
|
||||||
|
|
||||||
if (info.OwnerType == OwnerType.Victim)
|
if (info.OwnerType == OwnerType.Victim)
|
||||||
|
|||||||
Reference in New Issue
Block a user