package mapped;

import java.util.Comparator;
import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.api.RSGrandExchangeOfferOwnWorldComparator;

@ObfuscatedName("cn")
public class GrandExchangeOfferOwnWorldComparator implements Comparator, RSGrandExchangeOfferOwnWorldComparator {
   @ObfuscatedName("fp")
   @ObfuscatedSignature(
      descriptor = "Loh;"
   )
   static Archive archive8;
   @ObfuscatedName("gc")
   @ObfuscatedGetter(
      intValue = 1308920245
   )
   static int field478;
   @ObfuscatedName("at")
   boolean filterWorlds;

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(Log;Log;I)I",
      garbageValue = "-1440367085"
   )
   int method1252(GrandExchangeEvent var1, GrandExchangeEvent var2) {
      if(var2.world == var1.world) {
         return 0;
      } else {
         if(this.filterWorlds) {
            if(Client.worldId == var1.world) {
               return -1;
            }

            if(var2.world == Client.worldId) {
               return 1;
            }
         }

         return var1.world < var2.world?-1:1;
      }
   }

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

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