remove redundant parameter from ObjectCreator.Param attribute
This commit is contained in:
@@ -67,7 +67,7 @@ namespace OpenRA
|
||||
{
|
||||
var attrs = p[ i ].GetCustomAttributes<ParamAttribute>();
|
||||
if( attrs.Length != 1 ) throw new InvalidOperationException( "ObjectCreator: argument in [UseCtor] doesn't have [Param]" );
|
||||
a[ i ] = args[ attrs[ 0 ].ParamName ];
|
||||
a[ i ] = args[ attrs[ 0 ].ParamName ?? p[i].Name ];
|
||||
}
|
||||
return ctor.Invoke( a );
|
||||
}
|
||||
@@ -77,6 +77,8 @@ namespace OpenRA
|
||||
{
|
||||
public string ParamName { get; private set; }
|
||||
|
||||
public ParamAttribute() { }
|
||||
|
||||
public ParamAttribute( string paramName )
|
||||
{
|
||||
ParamName = paramName;
|
||||
|
||||
Reference in New Issue
Block a user