X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=CarFire%2FCarFire%2FMapProcessorLib%2FMapImporter.cs;fp=CarFire%2FCarFire%2FMapProcessorLib%2FMapImporter.cs;h=e208785179dfd84b7ede36c7026c5925312151c4;hb=c5daf1d9adca0c3a826dfa2ac7b6d4f8a64c84a3;hp=0000000000000000000000000000000000000000;hpb=14e69b6fff5171d3362c88fdaf00edf6ca4f6a13;p=chaz%2Fcarfire diff --git a/CarFire/CarFire/MapProcessorLib/MapImporter.cs b/CarFire/CarFire/MapProcessorLib/MapImporter.cs new file mode 100644 index 0000000..e208785 --- /dev/null +++ b/CarFire/CarFire/MapProcessorLib/MapImporter.cs @@ -0,0 +1,28 @@ +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); + } + } +}