package mapped;

import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.api.RSVarcInt;

@ObfuscatedName("gk")
public class VarcInt extends DualNode implements RSVarcInt {
   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "Llk;"
   )
   public static EvictingDualNodeHashTable VarcInt_cached;
   @ObfuscatedName("aj")
   @ObfuscatedSignature(
      descriptor = "Lgn;"
   )
   static ClanChannel field1851;
   @ObfuscatedName("ar")
   public boolean persist;

   static {
      VarcInt_cached = new EvictingDualNodeHashTable(64);
   }

   VarcInt() {
      this.persist = false;
   }

   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "(Luj;S)V",
      garbageValue = "-26758"
   )
   void method3593(Buffer var1) {
      while(true) {
         int var2 = var1.readUnsignedByte_base();
         if(var2 == 0) {
            return;
         }

         this.method3592(var1, var2);
      }
   }

   @ObfuscatedName("ar")
   @ObfuscatedSignature(
      descriptor = "(Luj;IB)V",
      garbageValue = "14"
   )
   void method3592(Buffer var1, int var2) {
      if(var2 == 2) {
         this.persist = true;
      }

   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "([BZI)Ljava/lang/Object;",
      garbageValue = "-875826715"
   )
   public static Object method3598_base(byte[] var0, boolean var1) {
      if(var0 == null) {
         return null;
      } else if(var0.length > 136) {
         DirectByteArrayCopier var2 = new DirectByteArrayCopier();
         var2.set_base(var0);
         return var2;
      } else {
         return var0;
      }
   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(B)V",
      garbageValue = "60"
   )
   public static void method3601_base() {
      class176.archive5.clear_base();
   }

   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "(III)V",
      garbageValue = "1925718940"
   )
   static void changeWorldSelectSorting_base(int var0, int var1) {
      int[] var2 = new int[4];
      int[] var3 = new int[4];
      var2[0] = var0;
      var3[0] = var1;
      int var4 = 1;

      for(int var5 = 0; var5 < 4; ++var5) {
         if(World.World_sortOption1[var5] != var0) {
            var2[var4] = World.World_sortOption1[var5];
            var3[var4] = World.World_sortOption2[var5];
            ++var4;
         }
      }

      World.World_sortOption1 = var2;
      World.World_sortOption2 = var3;
      class181.method3663(class361.World_worlds, 0, class361.World_worlds.length - 1, World.World_sortOption1, World.World_sortOption2);
   }
}
