using System; using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Microsoft.Xna.Framework.Content.Pipeline; using Microsoft.Xna.Framework.Content.Pipeline.Graphics; using TImport = MapProcessorLib.MapSourceCode; namespace MapProcessorLib { /// /// This class will be instantiated by the XNA Framework Content Pipeline /// to import a file from disk into the specified type, TImport. /// /// This should be part of a Content Pipeline Extension Library project. /// [ContentImporter(".cfmap", DisplayName = "CarFire Map Importer", DefaultProcessor = "PassThroughProcessor")] public class MapImporter : ContentImporter { public override TImport Import(string filename, ContentImporterContext context) { string[] lines = System.IO.File.ReadAllLines(filename); return new MapSourceCode(lines); } } }