package mapped;

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

@ObfuscatedName("er")
public class UserComparator3 extends AbstractUserComparator implements RSUserComparator3 {
   @ObfuscatedName("ji")
   static int[] regionLandArchiveIds;
   @ObfuscatedName("at")
   final boolean reversed;

   public UserComparator3(boolean var1) {
      this.reversed = var1;
   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(Lrh;Lrh;I)I",
      garbageValue = "1490590572"
   )
   int method2979(Buddy var1, Buddy var2) {
      return var2.world != var1.world?(this.reversed?var1.world - var2.world:var2.world - var1.world):this.method8173(var1, var2);
   }

   public int compare(Object var1, Object var2) {
      return this.method2979((Buddy)var1, (Buddy)var2);
   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(I)[Ldr;",
      garbageValue = "-253012574"
   )
   static class90[] method2985_base() {
      return new class90[]{class90.field1087, class90.field1091, class90.field1092, class90.field1086, class90.field1085, class90.field1084};
   }

   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "(III)I",
      garbageValue = "868585172"
   )
   static int method2984_base(int var0, int var1) {
      if(var0 == -2) {
         return 12345678;
      } else if(var0 == -1) {
         if(var1 < 0) {
            var1 = 0;
         } else if(var1 > 127) {
            var1 = 127;
         }

         var1 = 127 - var1;
         return var1;
      } else {
         var1 = (var0 & 127) * var1 / 128;
         if(var1 < 2) {
            var1 = 2;
         } else if(var1 > 126) {
            var1 = 126;
         }

         return (var0 & 65408) + var1;
      }
   }
}
