package mapped;

import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.api.RSApproximateRouteStrategy;

@ObfuscatedName("cm")
public class ApproximateRouteStrategy extends RouteStrategy implements RSApproximateRouteStrategy {
   @ObfuscatedName("wd")
   @ObfuscatedGetter(
      intValue = 1860064437
   )
   static int foundItemIndex;

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(IIILiw;I)Z",
      garbageValue = "729664573"
   )
   protected boolean vmethod4390(int var1, int var2, int var3, CollisionMap var4) {
      return var2 == super.approxDestinationX && var3 == super.approxDestinationY;
   }

   @ObfuscatedName("ar")
   @ObfuscatedSignature(
      descriptor = "(Ldo;Ldt;IIB)V",
      garbageValue = "113"
   )
   static void method1246(ScriptEvent var0, Script var1, int var2, int var3) {
      Client.copy$runScriptLogic(var0, var1, var2, var3, (byte)113);
   }

   @ObfuscatedName("bd")
   @ObfuscatedSignature(
      descriptor = "(ILdt;ZI)I",
      garbageValue = "1367539098"
   )
   static int method1251(int var0, Script var1, boolean var2) {
      int var3;
      int var4;
      int var6;
      if(var0 == 3400) {
         DbTableType.Interpreter_intStackSize -= 2;
         var3 = Interpreter.Interpreter_intStack[DbTableType.Interpreter_intStackSize];
         var4 = Interpreter.Interpreter_intStack[DbTableType.Interpreter_intStackSize + 1];
         EnumComposition var5 = ObjectComposition.method3947(var3);
         if(var5.outputType != 's') {
            ;
         }

         for(var6 = 0; var6 < var5.outputCount; ++var6) {
            if(var4 == var5.keys[var6]) {
               Interpreter.Interpreter_stringStack[++class127.Interpreter_stringStackSize - 1] = var5.strVals[var6];
               var5 = null;
               break;
            }
         }

         if(var5 != null) {
            Interpreter.Interpreter_stringStack[++class127.Interpreter_stringStackSize - 1] = var5.defaultStr;
         }

         return 1;
      } else if(var0 != 3408) {
         if(var0 == 3411) {
            var3 = Interpreter.Interpreter_intStack[--DbTableType.Interpreter_intStackSize];
            EnumComposition var10 = ObjectComposition.method3947(var3);
            Interpreter.Interpreter_intStack[++DbTableType.Interpreter_intStackSize - 1] = var10.size_base();
            return 1;
         } else {
            return 2;
         }
      } else {
         DbTableType.Interpreter_intStackSize -= 4;
         var3 = Interpreter.Interpreter_intStack[DbTableType.Interpreter_intStackSize];
         var4 = Interpreter.Interpreter_intStack[DbTableType.Interpreter_intStackSize + 1];
         int var9 = Interpreter.Interpreter_intStack[DbTableType.Interpreter_intStackSize + 2];
         var6 = Interpreter.Interpreter_intStack[DbTableType.Interpreter_intStackSize + 3];
         EnumComposition var7 = ObjectComposition.method3947(var9);
         if(var3 == var7.inputType && var4 == var7.outputType) {
            for(int var8 = 0; var8 < var7.outputCount; ++var8) {
               if(var6 == var7.keys[var8]) {
                  if(var4 == 115) {
                     Interpreter.Interpreter_stringStack[++class127.Interpreter_stringStackSize - 1] = var7.strVals[var8];
                  } else {
                     Interpreter.Interpreter_intStack[++DbTableType.Interpreter_intStackSize - 1] = var7.intVals[var8];
                  }

                  var7 = null;
                  break;
               }
            }

            if(var7 != null) {
               if(var4 == 115) {
                  Interpreter.Interpreter_stringStack[++class127.Interpreter_stringStackSize - 1] = var7.defaultStr;
               } else {
                  Interpreter.Interpreter_intStack[++DbTableType.Interpreter_intStackSize - 1] = var7.defaultInt;
               }
            }

            return 1;
         } else {
            if(var4 == 115) {
               Interpreter.Interpreter_stringStack[++class127.Interpreter_stringStackSize - 1] = "null";
            } else {
               Interpreter.Interpreter_intStack[++DbTableType.Interpreter_intStackSize - 1] = 0;
            }

            return 1;
         }
      }
   }

   @ObfuscatedName("iy")
   @ObfuscatedSignature(
      descriptor = "(I)I",
      garbageValue = "252815487"
   )
   static int getWindowedMode_base() {
      return Client.isResizable?2:1;
   }
}
