public Generator() { _graphics = new GraphicsDeviceManager(this); _englishChars = new List <char> { '©' }; for (var c = '!'; c < '~'; c++) { _englishChars.Add(c); } _characters = File.ReadAllText("chars.txt") .Except(_englishChars) .ToArray(); _compiler = new ContentCompiler(); _processor = new DynamicFontDescriptionProcessor(); _context = new DfgContext(this); Content.RootDirectory = "Content"; }
public Generator() { ReLogicPipeLineAssembly = typeof(DynamicFontDescription).Assembly; XnaPipeLineAssembly = typeof(ContentCompiler).Assembly; var type = XnaPipeLineAssembly.GetType("Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler.ContentCompiler"); var constructor = type .GetConstructors(BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance) .First(); _compiler = (ContentCompiler)constructor.Invoke(null); _compileMethod = type.GetMethod("Compile", BindingFlags.NonPublic | BindingFlags.Instance); _graphics = new GraphicsDeviceManager(this); _context = new DfgContext(this); _importContext = new DfgImporterContext(); _importer = (ContentImporter <DynamicFontDescription>)Activator.CreateInstance(ReLogicPipeLineAssembly.GetType("ReLogic.Content.Pipeline.DynamicFontImporter")); _processor = new DynamicFontProcessor(); Content.RootDirectory = "Content"; }