package mapped;

import java.util.Comparator;

import io.sentry.Sentry;
import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.api.RSGrandExchangeOfferWorldComparator;
import net.runelite.rs.api.RSRunException;

@ObfuscatedName("om")
final class GrandExchangeOfferWorldComparator implements Comparator, RSGrandExchangeOfferWorldComparator {
   @ObfuscatedName("ar")
   @ObfuscatedGetter(
      intValue = -689871749
   )
   public static int SpriteBuffer_spriteHeight;

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(Log;Log;I)I",
      garbageValue = "1620655261"
   )
   int method7117(GrandExchangeEvent var1, GrandExchangeEvent var2) {
      return var1.world < var2.world?-1:(var2.world == var1.world?0:1);
   }

   public int compare(Object var1, Object var2) {
      return this.method7117((GrandExchangeEvent)var1, (GrandExchangeEvent)var2);
   }

   public boolean equals(Object var1) {
      return super.equals(var1);
   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(Ljava/lang/String;Ljava/lang/Throwable;I)V",
      garbageValue = "939664876"
   )
   public static void RunException_sendStackTrace_base(String var0, Throwable var1) {
      if(var1 != null) {
         Sentry.captureException(var1);
         var1.printStackTrace();
      } else {
         if(var1 != null) {
            Throwable var2 = var1;
            if(var1 instanceof RSRunException) {
               var2 = ((RSRunException)var1).getParent();
            }

            SpriteMask.client.getLogger().error("Game crash: {}", var0, var2);
         }

      }
   }
}
