From a3ab1d77e7f7c72ffa1b1c6d599665bf80b91eae Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 17 Jan 2010 10:00:46 +1300 Subject: [PATCH] rename NewUnitInfo -> ActorInfo --- OpenRa.Game/Actor.cs | 2 +- .../{NewUnitInfo.cs => ActorInfo.cs} | 4 ++-- OpenRa.Game/GameRules/Rules.cs | 6 +++--- OpenRa.Game/GameRules/TechTree.cs | 8 ++++---- OpenRa.Game/OpenRa.Game.csproj | 2 +- OpenRa.Game/Traits/Production.cs | 4 ++-- OpenRa.Game/Traits/ProductionSurround.cs | 2 +- OpenRa.Game/Traits/TraitsInterfaces.cs | 2 +- mods/ra/OpenRa.Mods.RA.dll | Bin 9216 -> 9216 bytes 9 files changed, 15 insertions(+), 15 deletions(-) rename OpenRa.Game/GameRules/{NewUnitInfo.cs => ActorInfo.cs} (91%) mode change 100755 => 100644 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 eabdbe9fd0cdda04314a9416d3d791640fb625aa..64be24429730456bd590c0877e47c0f014d4f0ca 100644 GIT binary patch delta 565 zcmXYtPe@cz6vn^L;oSS)n-~-Vr>0FY8!=E}2*jc$jhu);Br0<=NP(-S!2;Wi5P<`c z$y?Mw5kf`w2bmrO5d_($LeqAVw5X&kYleXevPGSl<}QAm?|dKk+;hiz$9gZ1vsBDa zImi3uCOn+2aYF8e3}(cY2v+1L3~0i}U~`R~rrOzUT=8(xj2aJD%_DlaU8^6O>OBSL zOvuBmQ*=C({R^(o6aFTztM#rNpurP4q^!qQ@>M*K9)hOQ~*<^DKwvdQ}dclI9gW``$1KvuDa|5ny~m^xqWs}z0Y;;x{awUzKsNShf^Vt z4W30RBFUkVQ`zA0#?_F2Biho~-1BPs?MQsj_?-9Y(v@%7U@1D+z>pF delta 567 zcmXYtO=we55QWc4n0w!Q+K_@sB;5!>7ZIc-h*Cvb8fjbvB$TSnrif@ZrG|=si&R7~ z8?8JPs)7Vms@6q#qANk6Zv2bxx(QODT7_5w3jTpkV(#K&&YZ)YJ9m0`dU)mnhpOd@ zGd3c(;NfJOm*sxgpen9J@KL_QAZ)sfK~J0grqvlRu6Vd;&KM8Z%p-c3Yu67=>z?b* z@vw&lCvZG8{qwHRBmM@jKRGXZY4Aj{%IA_(N+=CtkF6;iHl_TbR5vJjmWOKc1yLXY zJxhFQ-mn|{J1S~FsG97kUG@^X@%F!Rb2hKur;c~i#?|}UQ7_u+TPNA&e_nIU)&;Ex z_~UC|mo`ZgJD8Lbexgs#A%ksFQ|^}E%2oVDFVm9205TH80Q2IIJgOa+MTsz>nR(5e zl^*WnDs;By2ieQ_n#rIcqa5cS$@2iiCWV4##??(rff*zYnn~(lbDF1El`^*=Yi`ix zsF~wN_L&DvA!HX>W=KC^maWBi!nZ40FX(C&E-Pp0+XnBp$5;8%`Nb;hzKsNSyVE2v z6+DYH#bytm7?~(c1&`OQg#Aivb95%+7RQS9!Fx+rucUL!cY?*(s}P6$+wmmV2k+ur Foqw%_hzS4y