]> Dogcows Code - chaz/carfire/blob - CarFire/CarFire/MapProcessorLib/MapImporter.cs
created a new project MapProcessorLib to for importing map files
[chaz/carfire] / CarFire / CarFire / MapProcessorLib / MapImporter.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Linq;
4 using Microsoft.Xna.Framework;
5 using Microsoft.Xna.Framework.Graphics;
6 using Microsoft.Xna.Framework.Content.Pipeline;
7 using Microsoft.Xna.Framework.Content.Pipeline.Graphics;
8
9 using TImport = MapProcessorLib.MapSourceCode;
10
11 namespace MapProcessorLib
12 {
13 /// <summary>
14 /// This class will be instantiated by the XNA Framework Content Pipeline
15 /// to import a file from disk into the specified type, TImport.
16 ///
17 /// This should be part of a Content Pipeline Extension Library project.
18 /// </summary>
19 [ContentImporter(".cfmap", DisplayName = "CarFire Map Importer", DefaultProcessor = "PassThroughProcessor")]
20 public class MapImporter : ContentImporter<TImport>
21 {
22 public override TImport Import(string filename, ContentImporterContext context)
23 {
24 string[] lines = System.IO.File.ReadAllLines(filename);
25 return new MapSourceCode(lines);
26 }
27 }
28 }
This page took 0.030097 seconds and 4 git commands to generate.