package mapped;

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

@ObfuscatedName("ei")
public class UserComparator7 extends AbstractUserComparator implements RSUserComparator7 {
   @ObfuscatedName("fw")
   @ObfuscatedSignature(
      descriptor = "Loh;"
   )
   static Archive field1441;
   @ObfuscatedName("jd")
   static int[] regionMapArchiveIds;
   @ObfuscatedName("at")
   final boolean reversed;

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

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

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

   @ObfuscatedName("an")
   @ObfuscatedSignature(
      descriptor = "(IB)V",
      garbageValue = "-90"
   )
   static void method2966_base(int var0) {
      if(var0 != Login.loginIndex) {
         Login.loginIndex = var0;
      }
   }

   @ObfuscatedName("ol")
   @ObfuscatedSignature(
      descriptor = "(Ljava/lang/String;I)Ljava/lang/String;",
      garbageValue = "-2025914903"
   )
   static String method2959_base(String var0) {
      PlayerType[] var1 = class320.method6191();

      for(int var2 = 0; var2 < var1.length; ++var2) {
         PlayerType var3 = var1[var2];
         if(var3.modIcon != -1 && var0.startsWith(FloorUnderlayDefinition.method3799_base(var3.modIcon))) {
            var0 = var0.substring(6 + Integer.toString(var3.modIcon).length());
            break;
         }
      }

      return var0;
   }
}
