remove ObjectCreator.Param and all associated nonsense

This commit is contained in:
Chris Forbes
2011-10-21 18:16:07 +13:00
parent 4c8e048c2c
commit 6010034b4a
69 changed files with 120 additions and 213 deletions

View File

@@ -78,8 +78,7 @@ namespace OpenRA
var a = new object[ p.Length ];
for( int i = 0 ; i < p.Length ; i++ )
{
var attr = p[ i ].GetCustomAttributes<ParamAttribute>().FirstOrDefault();
var key = (attr != null ? attr.ParamName : null) ?? p[i].Name;
var key = p[i].Name;
if ( !args.ContainsKey(key) ) throw new InvalidOperationException("ObjectCreator: key `{0}' not found".F(key));
a[ i ] = args[ key ];
}
@@ -94,22 +93,7 @@ namespace OpenRA
.Where(t => t != it && it.IsAssignableFrom(t)));
}
[AttributeUsage( AttributeTargets.Parameter )]
public class ParamAttribute : Attribute
{
public string ParamName { get; private set; }
public ParamAttribute() { }
public ParamAttribute( string paramName )
{
ParamName = paramName;
}
}
[AttributeUsage( AttributeTargets.Constructor )]
public class UseCtorAttribute : Attribute
{
}
public class UseCtorAttribute : Attribute {}
}
}