Cosmos/source2/Cosmos.Assembler/Code.cs
kudzu_cp 13cd53d468
2012-06-14 04:33:45 +00:00

22 lines
633 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
namespace Cosmos.Assembler {
public abstract class Code {
public abstract void Assemble();
// Assembles all descendants of this class in specified assembly.
static public void Assemble(Assembly aAssembly) {
foreach (var xType in aAssembly.GetTypes()) {
if (xType.IsSubclassOf(typeof(Code))) {
var xCtor = xType.GetConstructor(new Type[0]);
var xCode = (Code)(xCtor.Invoke(new Object[0]));
xCode.Assemble();
}
}
}
}
}