]> Dogcows Code - chaz/carfire/blob - CarFire/CarFire/MapProcessorLib/MapWriter.cs
created a new project MapProcessorLib to for importing map files
[chaz/carfire] / CarFire / CarFire / MapProcessorLib / MapWriter.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 using Microsoft.Xna.Framework.Content.Pipeline.Processors;
9 using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler;
10
11 using TWrite = MapProcessorLib.MapSourceCode;
12
13 namespace MapProcessorLib
14 {
15 /// <summary>
16 /// This class will be instantiated by the XNA Framework Content Pipeline
17 /// to write the specified data type into binary .xnb format.
18 ///
19 /// This should be part of a Content Pipeline Extension Library project.
20 /// </summary>
21 [ContentTypeWriter]
22 public class MapWriter : ContentTypeWriter<TWrite>
23 {
24 protected override void Write(ContentWriter output, TWrite value)
25 {
26 output.Write(value.Lines.Length);
27 foreach (string line in value.Lines)
28 {
29 output.Write(line);
30 }
31 }
32
33 public override string GetRuntimeReader(TargetPlatform targetPlatform)
34 {
35 return "CarFire.MapReader, CarFire";
36 }
37 }
38 }
This page took 0.030097 seconds and 4 git commands to generate.