private static void WriteMapWorld(BinaryWriter bw, World w) { bw.WriteVariableLengthString("CMapWorld"); WriteMapBase(bw, w); WriteEntityData(bw, w.EntityData); bw.Write(w.Paths.Count); foreach (var path in w.Paths) { WritePath(bw, path); } }
private static void WriteMapSolid(BinaryWriter bw, Solid s) { bw.WriteVariableLengthString("CMapSolid"); WriteMapBase(bw, s); bw.Write(s.Faces.Count); foreach (var face in s.Faces) { WriteFace(bw, face); } }
private static void WriteMapGroup(BinaryWriter bw, Group g) { bw.WriteVariableLengthString("CMapGroup"); WriteMapBase(bw, g); }
private static void WriteMapEntity(BinaryWriter bw, Entity ent) { bw.WriteVariableLengthString("CMapEntity"); WriteMapBase(bw, ent); WriteEntityData(bw, ent.EntityData); bw.Write(new byte[2]); // Unused bw.WriteCoordinate(ent.Origin); bw.Write(new byte[4]); // Unused }
private static void WriteEntityData(BinaryWriter bw, EntityData data) { bw.WriteVariableLengthString(data.Name); bw.Write(new byte[4]); // Unused bw.Write(data.Flags); bw.Write(data.Properties.Count); foreach (var property in data.Properties) { WriteProperty(bw, property); } bw.Write(new byte[12]); // Unused }
public static void WriteProperty(BinaryWriter bw, Property p) { bw.WriteVariableLengthString(p.Key); bw.WriteVariableLengthString(p.Value); }