现在有一些Mod,publicinterfaceIMod{TaskStart();TaskSuspend();}[AttributeUsage(AttributeTargets.Class)]sealedpublicclassModAttribute:Attribute{publicstringName{get;privates...
现在有一些Mod,
public interface IMod
{
Task Start ( );
Task Suspend ( );
}
[AttributeUsage ( AttributeTargets . Class )]
sealed public class ModAttribute : Attribute
{
public string Name { get; private set; }
public string Author { get; private set; }
public string Introduction { get; private set; }
public Guid Id { get; private set; }
public Collection Demand { get; private set; }
public ModAttribute ( string name , string author , string introduction , string id , string [ ] demend )
{
Name = name;
Author = author;
Introduction = introduction;
Id = Guid . Parse ( id );
Demand = new Collection ( );
if ( demend != null )
{
foreach ( var item in demend )
{
Demand . Add ( Guid . Parse ( item ) );
}
}
}
}
而每个mod的依赖项需要作为构造函数的参数传入
所以我希望Mod的加载顺序
详见https://github.com/OrangeEndless/OEL
展开