public static PlayerAction[] GetAllPlayerActions(System.Reflection.Assembly assembly)
{
var result = new List<PlayerAction>();
foreach (Type innerType in assembly.GetTypes())
{
if (!innerType.IsClass)
continue;
if (innerType.Namespace != "Strategies")
continue;
System.Reflection.MethodInfo playerMethodInfo = innerType.GetMethod("Player", System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static);
if (playerMethodInfo == null)
continue;
if (playerMethodInfo.ContainsGenericParameters)
continue;
if (playerMethodInfo.GetParameters().Length > 0)
{
continue;
}
PlayerAction playerAction = playerMethodInfo.Invoke(null, new object[0]) as PlayerAction;
if (playerAction == null)
continue;
result.Add(playerAction);
}
return result.ToArray();
}