expose appropriate *Inits, and make them work in editor

This commit is contained in:
Chris Forbes
2011-11-06 18:15:56 +13:00
parent 772734d032
commit 6cb8ee1f9f
17 changed files with 332 additions and 28 deletions

View File

@@ -15,8 +15,8 @@ namespace OpenRA.FileFormats
{
public class ActorReference : IEnumerable
{
public readonly string Type;
public readonly TypeDictionary InitDict;
public string Type;
public TypeDictionary InitDict;
public ActorReference( string type ) : this( type, new Dictionary<string, MiniYaml>() ) { }

View File

@@ -121,8 +121,7 @@ namespace OpenRA
return inits.Select(
i => Pair.New(
i.GetType().Name.Replace( "Init", "" ),
i.GetType().GetInterfaces()[0].GetGenericArguments()[0] ) );
i.Name.Replace( "Init", "" ), i ));
}
}
}

View File

@@ -14,7 +14,7 @@ using OpenRA.GameRules;
namespace OpenRA.Traits
{
public class HealthInfo : ITraitInfo
public class HealthInfo : ITraitInfo, UsesInit<HealthInit>
{
public readonly int HP = 0;
public readonly float Radius = 10;