public override int WriteTo(byte[] Buffer, int StartIndex = 0) { int cursor = StartIndex; Buffer[cursor] = (byte)CommandType; // Type (1 byte) cursor++; cursor += DiplomacyInfo.WriteTo(Buffer, cursor); // DiplomacyInfo (n bytes) return(cursor - StartIndex); }
public override int ReadFrom(byte[] Buffer, int StartIndex = 0) { int cursor = StartIndex; if ((UserCommandType)Buffer[cursor] != CommandType) { throw new Exception(ERRORWRONGTYPEBYTE); } else { cursor++; // Type (1 byte) DiplomacyInfo = new DiplomacyInfo(Buffer, cursor); // DiplomacyInfo (n bytes) cursor += DiplomacyInfo.ByteLength; } return(cursor - StartIndex); }
public UserCommandGuildGuildList(DiplomacyInfo DiplomacyInfo) { this.DiplomacyInfo = DiplomacyInfo; }