namespace Passer.RoboidControl { /// /// Message notifiying that a Thing no longer exists /// public class DestroyMsg : IMessage { /// /// The message ID /// public const byte Id = 0x20; /// /// The length of the message /// public const byte length = 3; /// /// The network ID of the thing /// public byte networkId; /// /// The ID of the thing /// public byte thingId; /// /// Create a message for sending /// /// The network ID of the thing /// The ID of the thing public DestroyMsg(byte networkId, byte thingId) { this.networkId = networkId; this.thingId = thingId; } /// @copydoc Passer::RoboidControl::IMessage::IMessage(byte[] buffer) public DestroyMsg(byte[] buffer) : base(buffer) { } /// @copydoc Passer::RoboidControl::IMessage::Serialize public override byte Serialize(ref byte[] buffer) { if (buffer.Length < DestroyMsg.length) return 0; byte ix = 0; buffer[ix++] = DestroyMsg.Id; buffer[ix++] = this.networkId; buffer[ix++] = this.thingId; return ix; } } }