using System;
using System.Collections.Generic;
using System.IO;
using Nibriboard.RippleSpace;
namespace Nibriboard.Client.Messages
{
public class ChunkUpdateRequestMessage : Message
{
///
/// A list of chunks that the client has intentionally forgotten about, and will need
/// to be resent to the client.
///
public List ForgottenChunks = new List();
public ChunkUpdateRequestMessage()
{
}
public List ForgottenChunksAsReferences(Plane plane)
{
List result = new List();
foreach(RawChunkReference rawRef in ForgottenChunks)
{
if(rawRef.planeName as string != plane.Name)
throw new InvalidDataException($"Error: A raw reference was for the plane " +
"'{rawRef.planeName}', but the plane '{plane.Name}' " +
"was specified as the plane to lay the chunk references onto!");
result.Add(new ChunkReference(plane, rawRef.x, rawRef.y));
}
return result;
}
}
}