Rename RaceInit to FactionInit
This commit is contained in:
@@ -78,7 +78,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
new LocationInit(t),
|
||||
new OwnerInit(order.Player),
|
||||
new RaceInit(race)
|
||||
new FactionInit(race)
|
||||
});
|
||||
|
||||
if (playSounds)
|
||||
@@ -119,7 +119,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
new LocationInit(order.TargetLocation),
|
||||
new OwnerInit(order.Player),
|
||||
new RaceInit(race),
|
||||
new FactionInit(race),
|
||||
});
|
||||
|
||||
foreach (var s in buildingInfo.BuildSounds)
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
playerPower = playerActor.Trait<PowerManager>();
|
||||
developerMode = playerActor.Trait<DeveloperMode>();
|
||||
|
||||
Race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : self.Owner.Faction.InternalName;
|
||||
Race = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName;
|
||||
Enabled = !info.Race.Any() || info.Race.Contains(Race);
|
||||
|
||||
CacheProduceables(playerActor);
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (string.IsNullOrEmpty(prerequisite))
|
||||
prerequisite = init.Self.Info.Name;
|
||||
|
||||
var race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Faction.InternalName;
|
||||
var race = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName;
|
||||
|
||||
Update(init.Self.Owner, race);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
Info = info;
|
||||
rp = Exts.Lazy(() => init.Self.IsDead ? null : init.Self.TraitOrDefault<RallyPoint>());
|
||||
Race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Faction.InternalName;
|
||||
Race = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName;
|
||||
}
|
||||
|
||||
public void DoProduction(Actor self, ActorInfo producee, ExitInfo exitinfo, string raceVariant)
|
||||
@@ -69,7 +69,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
};
|
||||
|
||||
if (raceVariant != null)
|
||||
td.Add(new RaceInit(raceVariant));
|
||||
td.Add(new FactionInit(raceVariant));
|
||||
|
||||
var newUnit = self.World.CreateActor(producee.Name, td);
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public IEnumerable<IActorPreview> RenderPreview(ActorPreviewInitializer init)
|
||||
{
|
||||
var sequenceProvider = init.World.Map.SequenceProvider;
|
||||
var race = init.Get<RaceInit, string>();
|
||||
var race = init.Get<FactionInit, string>();
|
||||
var ownerName = init.Get<OwnerInit>().PlayerName;
|
||||
var image = GetImage(init.Actor, sequenceProvider, race);
|
||||
var palette = init.WorldRenderer.Palette(Palette ?? PlayerPalette + ownerName);
|
||||
@@ -145,7 +145,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public RenderSprites(ActorInitializer init, RenderSpritesInfo info)
|
||||
{
|
||||
this.info = info;
|
||||
race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Faction.InternalName;
|
||||
race = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : init.Self.Owner.Faction.InternalName;
|
||||
}
|
||||
|
||||
public string GetImage(Actor self)
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public virtual IEnumerable<IActorPreview> RenderPreview(ActorPreviewInitializer init)
|
||||
{
|
||||
var body = init.Actor.Traits.Get<BodyOrientationInfo>();
|
||||
var race = init.Get<RaceInit, string>();
|
||||
var race = init.Get<FactionInit, string>();
|
||||
var ownerName = init.Get<OwnerInit>().PlayerName;
|
||||
var sequenceProvider = init.World.Map.SequenceProvider;
|
||||
var image = Image ?? init.Actor.Name;
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
self = init.Self;
|
||||
this.info = info;
|
||||
buildingInfo = self.World.Map.Rules.Actors[info.IntoActor].Traits.GetOrDefault<BuildingInfo>();
|
||||
race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : self.Owner.Faction.InternalName;
|
||||
race = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName;
|
||||
}
|
||||
|
||||
public string VoicePhraseForOrder(Actor self, Order order)
|
||||
|
||||
@@ -43,8 +43,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
this.Owner = owner;
|
||||
this.worldRenderer = worldRenderer;
|
||||
|
||||
if (!actor.InitDict.Contains<RaceInit>())
|
||||
actor.InitDict.Add(new RaceInit(owner.Faction));
|
||||
if (!actor.InitDict.Contains<FactionInit>())
|
||||
actor.InitDict.Add(new FactionInit(owner.Faction));
|
||||
|
||||
if (!actor.InitDict.Contains<OwnerInit>())
|
||||
actor.InitDict.Add(new OwnerInit(owner.Name));
|
||||
@@ -118,8 +118,8 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
Func<object, bool> saveInit = init =>
|
||||
{
|
||||
var race = init as RaceInit;
|
||||
if (race != null && race.Race == Owner.Faction)
|
||||
var factionInit = init as FactionInit;
|
||||
if (factionInit != null && factionInit.Faction == Owner.Faction)
|
||||
return false;
|
||||
|
||||
// TODO: Other default values will need to be filtered
|
||||
|
||||
Reference in New Issue
Block a user