Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using Past.Protocol;
- using Past.IO;
- namespace Past.Protocol.Messages.debug
- {
- public class DebugHighlightCellsMessage
- {
- public new const uint ID = 2001;
- public override uint ProtocolID
- {
- get { return ID; }
- }
- public int color;
- public short[] cells;
- public DebugHighlightCellsMessage()
- {
- }
- public DebugHighlightCellsMessage(int color, short[] cells)
- {
- this.color = color;
- this.cells = cells;
- }
- public override void Serialize(BigEndianWriter writer)
- {
- writer.WriteInt(color);
- writer.WriteUShort((ushort)cells.Length);
- foreach (var entry in cells)
- {
- writer.WriteShort(entry);
- }
- }
- public override void Deserialize(BigEndianReader reader)
- {
- color = reader.ReadInt();
- var limit = reader.ReadUShort();
- cells = new short[limit];
- for (int i = 0; i < limit; i++)
- {
- cells[i] = reader.ReadShort();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement