mirror of
https://github.com/NexusForever/NexusForever
synced 2026-08-14 00:26:05 -04:00
Currently only contain zones information, in the future terrain height, auras and liquid data will be stored in them too.
34 lines
805 B
C#
34 lines
805 B
C#
using System;
|
|
using System.IO;
|
|
using NexusForever.Shared.IO;
|
|
using NexusForever.Shared.IO.Map;
|
|
|
|
namespace NexusForever.MapGenerator.IO.Map
|
|
{
|
|
public class WritableMapFileGrid : MapFileGrid, IWritable
|
|
{
|
|
public WritableMapFileGrid(uint x, uint y)
|
|
{
|
|
X = x;
|
|
Y = y;
|
|
}
|
|
|
|
public void Write(BinaryWriter writer)
|
|
{
|
|
writer.Write(X);
|
|
writer.Write(Y);
|
|
|
|
writer.Write(cells.Count);
|
|
foreach (WritableMapFileCell cell in cells.Values)
|
|
cell.Write(writer);
|
|
}
|
|
|
|
public void AddCell(WritableMapFileCell cell)
|
|
{
|
|
if (cell == null)
|
|
throw new ArgumentNullException();
|
|
|
|
cells.Add((cell.X << 16) | cell.Y, cell);
|
|
}
|
|
}
|
|
}
|