Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 public UserCommandGuildGuildList(DiplomacyInfo DiplomacyInfo)
 {
     this.DiplomacyInfo = DiplomacyInfo;
 }