/// <summary> /// Adds the map lumps to a Doom wad file. /// </summary> /// <param name="wad">The wad file to which the map should be added</param> public void AddToWad(WadFile wad) { wad.AddLump(Name, new byte[0]); wad.AddLump("LINEDEFS", Linedefs.SelectMany(x => x.ToBytes()).ToArray()); wad.AddLump("SECTORS", Sectors.SelectMany(x => x.ToBytes()).ToArray()); wad.AddLump("SIDEDEFS", Sidedefs.SelectMany(x => x.ToBytes()).ToArray()); wad.AddLump("THINGS", Things.SelectMany(x => x.ToBytes()).ToArray()); wad.AddLump("VERTEXES", Vertices.SelectMany(x => x.ToBytes()).ToArray()); }
/// <summary> /// Adds this company to the given sector if it has not been added /// already. Also checks sector aliases of all sectors the company /// is already added to. /// </summary> public void AddToSectorIfNew(Sector sector) { if (Sectors.FirstOrDefault(s => s.Name == sector.Name) != null) { return; } if (Sectors.SelectMany(s => s.Aliases).FirstOrDefault(a => a.Name == sector.Name) != null) { return; } Sectors.Add(sector); }