diff --git a/OpenRa.Game/Actor.cs b/OpenRa.Game/Actor.cs index 47acc2a72d..a33251776f 100755 --- a/OpenRa.Game/Actor.cs +++ b/OpenRa.Game/Actor.cs @@ -13,7 +13,7 @@ namespace OpenRa { [Sync] public readonly TypeDictionary traits = new TypeDictionary(); - public readonly NewUnitInfo Info; + public readonly ActorInfo Info; public readonly uint ActorID; [Sync] public int2 Location; diff --git a/OpenRa.Game/GameRules/NewUnitInfo.cs b/OpenRa.Game/GameRules/ActorInfo.cs old mode 100755 new mode 100644 similarity index 91% rename from OpenRa.Game/GameRules/NewUnitInfo.cs rename to OpenRa.Game/GameRules/ActorInfo.cs index b69d5e8745..c5b495abd7 --- a/OpenRa.Game/GameRules/NewUnitInfo.cs +++ b/OpenRa.Game/GameRules/ActorInfo.cs @@ -9,13 +9,13 @@ using System.IO; namespace OpenRa.GameRules { - public class NewUnitInfo + public class ActorInfo { public readonly string Name; public readonly string Category; public readonly TypeDictionary Traits = new TypeDictionary(); - public NewUnitInfo( string name, MiniYaml node, Dictionary allUnits ) + public ActorInfo( string name, MiniYaml node, Dictionary allUnits ) { var mergedNode = MergeWithParent( node, allUnits ).Nodes; diff --git a/OpenRa.Game/GameRules/Rules.cs b/OpenRa.Game/GameRules/Rules.cs index c79ce4a3fa..47580e7ca8 100755 --- a/OpenRa.Game/GameRules/Rules.cs +++ b/OpenRa.Game/GameRules/Rules.cs @@ -22,7 +22,7 @@ namespace OpenRa public static Map Map; public static TileSet TileSet; - public static Dictionary NewUnitInfo; + public static Dictionary NewUnitInfo; public static void LoadRules(string mapFileName, bool useAftermath) { @@ -70,9 +70,9 @@ namespace OpenRa yamlRules = MiniYaml.Merge( MiniYaml.FromFile( "[mod]Separate buildqueue for defense.yaml" ), yamlRules ); - NewUnitInfo = new Dictionary(); + NewUnitInfo = new Dictionary(); foreach( var kv in yamlRules ) - NewUnitInfo.Add(kv.Key.ToLowerInvariant(), new NewUnitInfo(kv.Key.ToLowerInvariant(), kv.Value, yamlRules)); + NewUnitInfo.Add(kv.Key.ToLowerInvariant(), new ActorInfo(kv.Key.ToLowerInvariant(), kv.Value, yamlRules)); TechTree = new TechTree(); Map = new Map( AllRules ); diff --git a/OpenRa.Game/GameRules/TechTree.cs b/OpenRa.Game/GameRules/TechTree.cs index f11343fc39..05dac5e9e9 100755 --- a/OpenRa.Game/GameRules/TechTree.cs +++ b/OpenRa.Game/GameRules/TechTree.cs @@ -7,7 +7,7 @@ namespace OpenRa.GameRules { public class TechTree { - readonly Cache> producesIndex = new Cache>(x => new List()); + readonly Cache> producesIndex = new Cache>(x => new List()); public TechTree() { @@ -34,7 +34,7 @@ namespace OpenRa.GameRules return ret; } - public bool CanBuild( NewUnitInfo info, Player player, Cache> playerBuildings ) + public bool CanBuild( ActorInfo info, Player player, Cache> playerBuildings ) { var bi = info.Traits.GetOrDefault(); if( bi == null ) return false; @@ -60,7 +60,7 @@ namespace OpenRa.GameRules yield return unit.Name; } - public IEnumerable AllBuildables(Player player, params string[] categories) + public IEnumerable AllBuildables(Player player, params string[] categories) { return Rules.NewUnitInfo.Values .Where( x => x.Name[ 0 ] != '^' ) @@ -68,7 +68,7 @@ namespace OpenRa.GameRules .Where( x => x.Traits.Contains() ); } - public IEnumerable UnitBuiltAt( NewUnitInfo info ) + public IEnumerable UnitBuiltAt( ActorInfo info ) { var builtAt = info.Traits.Get().BuiltAt; if( builtAt.Length != 0 ) diff --git a/OpenRa.Game/OpenRa.Game.csproj b/OpenRa.Game/OpenRa.Game.csproj index 8e756e5a09..382dc47bb1 100644 --- a/OpenRa.Game/OpenRa.Game.csproj +++ b/OpenRa.Game/OpenRa.Game.csproj @@ -95,7 +95,7 @@ - + diff --git a/OpenRa.Game/Traits/Production.cs b/OpenRa.Game/Traits/Production.cs index 7b261885ae..afeb6ec3ea 100755 --- a/OpenRa.Game/Traits/Production.cs +++ b/OpenRa.Game/Traits/Production.cs @@ -19,7 +19,7 @@ namespace OpenRa.Traits public Production( Actor self ) { } - public virtual int2? CreationLocation( Actor self, NewUnitInfo producee ) + public virtual int2? CreationLocation( Actor self, ActorInfo producee ) { return ( 1 / 24f * self.CenterLocation ).ToInt2(); } @@ -29,7 +29,7 @@ namespace OpenRa.Traits return newUnit.Info.Traits.GetOrDefault().InitialFacing; } - public bool Produce( Actor self, NewUnitInfo producee ) + public bool Produce( Actor self, ActorInfo producee ) { var location = CreationLocation( self, producee ); if( location == null || Game.UnitInfluence.GetUnitsAt( location.Value ).Any() ) diff --git a/OpenRa.Game/Traits/ProductionSurround.cs b/OpenRa.Game/Traits/ProductionSurround.cs index 3d79f27f3d..46d65117d6 100644 --- a/OpenRa.Game/Traits/ProductionSurround.cs +++ b/OpenRa.Game/Traits/ProductionSurround.cs @@ -26,7 +26,7 @@ namespace OpenRa.Traits return null; } - public override int2? CreationLocation(Actor self, NewUnitInfo producee) + public override int2? CreationLocation(Actor self, ActorInfo producee) { return FindAdjacentTile(self, producee.Traits.Get().WaterBound ? UnitMovementType.Float : UnitMovementType.Wheel); /* hackety hack */ diff --git a/OpenRa.Game/Traits/TraitsInterfaces.cs b/OpenRa.Game/Traits/TraitsInterfaces.cs index 7b51842468..cfe91c65a5 100644 --- a/OpenRa.Game/Traits/TraitsInterfaces.cs +++ b/OpenRa.Game/Traits/TraitsInterfaces.cs @@ -27,7 +27,7 @@ namespace OpenRa.Traits interface IProducer { - bool Produce( Actor self, NewUnitInfo producee ); + bool Produce( Actor self, ActorInfo producee ); void SetPrimaryProducer(Actor self, bool isPrimary); } public interface IOccupySpace { IEnumerable OccupiedCells(); } diff --git a/mods/ra/OpenRa.Mods.RA.dll b/mods/ra/OpenRa.Mods.RA.dll index eabdbe9fd0..64be244297 100644 Binary files a/mods/ra/OpenRa.Mods.RA.dll and b/mods/ra/OpenRa.Mods.RA.dll differ