text: /*
   * This file has been automatically generated by Soupply and released under the MIT license.
   * Generated from data/java315.xml
   */
  import Packet from 'packet';
  import Types from 'types';
  
  const Login = {
  
    Disconnect: class extends Packet {
  
      static get ID(){ return 0; };
  
      static get CLIENTBOUND(){ return true; };
      static get SERVERBOUND(){ return false; };
  
      getId() {
        return 0;
      }
  
      constructor(reason="") {
        super();
        this.reason = reason;
      }
  
      /** @return {Uint8Array} */
      encodeBody(reset) {
        if(reset) {
          this.reset();
        }
        var dhc5zfb4=this.encodeString(this.reason);
        this.writeVaruint(dhc5zfb4.length);
        this.writeBytes(dhc5zfb4);
        return new Uint8Array(this._buffer);
      }
  
      /** @param {(Uint8Array|Array)} buffer */
      decodeBody(_buffer) {
        this._buffer=Array.from(_buffer);
        initDecode(this);
        var dhc5zfb4=this.readVaruint();
        this.reason=this.decodeString(this.readBytes(dhc5zfb4));
        traceDecode('reason');
        return this;
      }
  
      /** @return {string} */
      toString() {
        return "Disconnect(reason: " + this.reason + ")";
      }
  
    }
    ,
  
    LoginStart: class extends Packet {
  
      static get ID(){ return 0; };
  
      static get CLIENTBOUND(){ return false; };
      static get SERVERBOUND(){ return true; };
  
      getId() {
        return 0;
      }
  
      constructor(username="") {
        super();
        this.username = username;
      }
  
      /** @return {Uint8Array} */
      encodeBody(reset) {
        if(reset) {
          this.reset();
        }
        var dhc5cvbf=this.encodeString(this.username);
        this.writeVaruint(dhc5cvbf.length);
        this.writeBytes(dhc5cvbf);
        return new Uint8Array(this._buffer);
      }
  
      /** @param {(Uint8Array|Array)} buffer */
      decodeBody(_buffer) {
        this._buffer=Array.from(_buffer);
        initDecode(this);
        var dhc5cvbf=this.readVaruint();
        this.username=this.decodeString(this.readBytes(dhc5cvbf));
        traceDecode('username');
        return this;
      }
  
      /** @return {string} */
      toString() {
        return "LoginStart(username: " + this.username + ")";
      }
  
    }
    ,
  
    EncryptionRequest: class extends Packet {
  
      static get ID(){ return 1; };
  
      static get CLIENTBOUND(){ return true; };
      static get SERVERBOUND(){ return false; };
  
      getId() {
        return 1;
      }
  
      constructor(serverId="", publicKey=new Uint8Array(0), verifyToken=new Uint8Array(0)) {
        super();
        this.serverId = serverId;
        this.publicKey = publicKey;
        this.verifyToken = verifyToken;
      }
  
      /** @return {Uint8Array} */
      encodeBody(reset) {
        if(reset) {
          this.reset();
        }
        var dhc5zjzj=this.encodeString(this.serverId);
        this.writeVaruint(dhc5zjzj.length);
        this.writeBytes(dhc5zjzj);
        this.writeVaruint(this.publicKey.length);
        this.writeBytes(this.publicKey);
        this.writeVaruint(this.verifyToken.length);
        this.writeBytes(this.verifyToken);
        return new Uint8Array(this._buffer);
      }
  
      /** @param {(Uint8Array|Array)} buffer */
      decodeBody(_buffer) {
        this._buffer=Array.from(_buffer);
        initDecode(this);
        var dhc5zjzj=this.readVaruint();
        this.serverId=this.decodeString(this.readBytes(dhc5zjzj));
        traceDecode('serverId');
        var aramcvbl=this.readVaruint();
        this.publicKey=this.readBytes(aramcvbl);
        traceDecode('publicKey');
        var aramdvaz=this.readVaruint();
        this.verifyToken=this.readBytes(aramdvaz);
        traceDecode('verifyToken');
        return this;
      }
  
      /** @return {string} */
      toString() {
        return "EncryptionRequest(serverId: " + this.serverId + ", publicKey: " + this.publicKey + ", verifyToken: " + this.verifyToken + ")";
      }
  
    }
    ,
  
    EncryptionResponse: class extends Packet {
  
      static get ID(){ return 1; };
  
      static get CLIENTBOUND(){ return false; };
      static get SERVERBOUND(){ return true; };
  
      getId() {
        return 1;
      }
  
      constructor(sharedSecret=new Uint8Array(0), verifyToken=new Uint8Array(0)) {
        super();
        this.sharedSecret = sharedSecret;
        this.verifyToken = verifyToken;
      }
  
      /** @return {Uint8Array} */
      encodeBody(reset) {
        if(reset) {
          this.reset();
        }
        this.writeVaruint(this.sharedSecret.length);
        this.writeBytes(this.sharedSecret);
        this.writeVaruint(this.verifyToken.length);
        this.writeBytes(this.verifyToken);
        return new Uint8Array(this._buffer);
      }
  
      /** @param {(Uint8Array|Array)} buffer */
      decodeBody(_buffer) {
        this._buffer=Array.from(_buffer);
        initDecode(this);
        var aramchcv=this.readVaruint();
        this.sharedSecret=this.readBytes(aramchcv);
        traceDecode('sharedSecret');
        var aramdvaz=this.readVaruint();
        this.verifyToken=this.readBytes(aramdvaz);
        traceDecode('verifyToken');
        return this;
      }
  
      /** @return {string} */
      toString() {
        return "EncryptionResponse(sharedSecret: " + this.sharedSecret + ", verifyToken: " + this.verifyToken + ")";
      }
  
    }
    ,
  
    LoginSuccess: class extends Packet {
  
      static get ID(){ return 2; };
  
      static get CLIENTBOUND(){ return true; };
      static get SERVERBOUND(){ return false; };
  
      getId() {
        return 2;
      }
  
      constructor(uuid="", username="") {
        super();
        this.uuid = uuid;
        this.username = username;
      }
  
      /** @return {Uint8Array} */
      encodeBody(reset) {
        if(reset) {
          this.reset();
        }
        var dhc5dl=this.encodeString(this.uuid);
        this.writeVaruint(dhc5dl.length);
        this.writeBytes(dhc5dl);
        var dhc5cvbf=this.encodeString(this.username);
        this.writeVaruint(dhc5cvbf.length);
        this.writeBytes(dhc5cvbf);
        return new Uint8Array(this._buffer);
      }
  
      /** @param {(Uint8Array|Array)} buffer */
      decodeBody(_buffer) {
        this._buffer=Array.from(_buffer);
        initDecode(this);
        var dhc5dl=this.readVaruint();
        this.uuid=this.decodeString(this.readBytes(dhc5dl));
        traceDecode('uuid');
        var dhc5cvbf=this.readVaruint();
        this.username=this.decodeString(this.readBytes(dhc5cvbf));
        traceDecode('username');
        return this;
      }
  
      /** @return {string} */
      toString() {
        return "LoginSuccess(uuid: " + this.uuid + ", username: " + this.username + ")";
      }
  
    }
    ,
  
    SetCompression: class extends Packet {
  
      static get ID(){ return 3; };
  
      static get CLIENTBOUND(){ return true; };
      static get SERVERBOUND(){ return false; };
  
      getId() {
        return 3;
      }
  
      constructor(thresold=0) {
        super();
        this.thresold = thresold;
      }
  
      /** @return {Uint8Array} */
      encodeBody(reset) {
        if(reset) {
          this.reset();
        }
        this.writeVaruint(this.thresold);
        return new Uint8Array(this._buffer);
      }
  
      /** @param {(Uint8Array|Array)} buffer */
      decodeBody(_buffer) {
        this._buffer=Array.from(_buffer);
        initDecode(this);
        this.thresold=this.readVaruint();
        traceDecode('thresold');
        return this;
      }
  
      /** @return {string} */
      toString() {
        return "SetCompression(thresold: " + this.thresold + ")";
      }
  
    }
  
  }
  
  module.export = Login;
  