]> Dogcows Code - chaz/carfire/blobdiff - CarFire/CarFire/MapProcessorLib/MapImporter.cs
created a new project MapProcessorLib to for importing map files
[chaz/carfire] / CarFire / CarFire / MapProcessorLib / MapImporter.cs
diff --git a/CarFire/CarFire/MapProcessorLib/MapImporter.cs b/CarFire/CarFire/MapProcessorLib/MapImporter.cs
new file mode 100644 (file)
index 0000000..e208785
--- /dev/null
@@ -0,0 +1,28 @@
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using Microsoft.Xna.Framework;\r
+using Microsoft.Xna.Framework.Graphics;\r
+using Microsoft.Xna.Framework.Content.Pipeline;\r
+using Microsoft.Xna.Framework.Content.Pipeline.Graphics;\r
+\r
+using TImport = MapProcessorLib.MapSourceCode;\r
+\r
+namespace MapProcessorLib\r
+{\r
+    /// <summary>\r
+    /// This class will be instantiated by the XNA Framework Content Pipeline\r
+    /// to import a file from disk into the specified type, TImport.\r
+    /// \r
+    /// This should be part of a Content Pipeline Extension Library project.\r
+    /// </summary>\r
+    [ContentImporter(".cfmap", DisplayName = "CarFire Map Importer", DefaultProcessor = "PassThroughProcessor")]\r
+    public class MapImporter : ContentImporter<TImport>\r
+    {\r
+        public override TImport Import(string filename, ContentImporterContext context)\r
+        {\r
+            string[] lines = System.IO.File.ReadAllLines(filename);\r
+            return new MapSourceCode(lines);\r
+        }\r
+    }\r
+}\r
This page took 0.021835 seconds and 4 git commands to generate.