package mapped;

import java.io.File;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.api.RSJagexCache;

@ObfuscatedName("if")
public class JagexCache implements RSJagexCache {
   @ObfuscatedName("ao")
   static File field2284;
   @ObfuscatedName("ab")
   static File cacheDir;
   @ObfuscatedName("av")
   @ObfuscatedSignature(
      descriptor = "Ltr;"
   )
   public static BufferedFile JagexCache_randomDat;
   @ObfuscatedName("ax")
   @ObfuscatedSignature(
      descriptor = "Ltr;"
   )
   public static BufferedFile JagexCache_dat2File;
   @ObfuscatedName("as")
   @ObfuscatedSignature(
      descriptor = "Ltr;"
   )
   public static BufferedFile JagexCache_idx255File;

   static {
      JagexCache_randomDat = null;
      JagexCache_dat2File = null;
      JagexCache_idx255File = null;
   }

   @ObfuscatedName("lu")
   @ObfuscatedSignature(
      descriptor = "(Lnn;IIB)V",
      garbageValue = "80"
   )
   static void method4213(Widget var0, int var1, int var2) {
      if(var0.getXPositionMode() == 0) {
         var0.setRelativeX(var0.getOriginalX());
         var0.setForcedX();
      } else if(var0.getXPositionMode() == 1) {
         var0.setRelativeX(var0.getOriginalX() + (var1 - var0.getWidth()) / 2);
         var0.setForcedX();
      } else if(var0.getXPositionMode() == 2) {
         var0.setRelativeX(var1 - var0.getWidth() - var0.getOriginalX());
         var0.setForcedX();
      } else if(var0.getXPositionMode() == 3) {
         var0.setRelativeX(var0.getOriginalX() * var1 >> 14);
         var0.setForcedX();
      } else if(var0.getXPositionMode() == 4) {
         var0.setRelativeX((var0.getOriginalX() * var1 >> 14) + (var1 - var0.getWidth()) / 2);
         var0.setForcedX();
      } else {
         var0.setRelativeX(var1 - var0.getWidth() - (var0.getOriginalX() * var1 >> 14));
         var0.setForcedX();
      }

      if(var0.getYPositionMode() == 0) {
         var0.setRelativeY(var0.getOriginalY());
         var0.setForcedY();
      } else if(var0.getYPositionMode() == 1) {
         var0.setRelativeY((var2 - var0.getHeight()) / 2 + var0.getOriginalY());
         var0.setForcedY();
      } else if(var0.getYPositionMode() == 2) {
         var0.setRelativeY(var2 - var0.getHeight() - var0.getOriginalY());
         var0.setForcedY();
      } else if(var0.getYPositionMode() == 3) {
         var0.setRelativeY(var2 * var0.getOriginalY() >> 14);
         var0.setForcedY();
      } else if(var0.getYPositionMode() == 4) {
         var0.setRelativeY((var2 - var0.getHeight()) / 2 + (var2 * var0.getOriginalY() >> 14));
         var0.setForcedY();
      } else {
         var0.setRelativeY(var2 - var0.getHeight() - (var2 * var0.getOriginalY() >> 14));
         var0.setForcedY();
      }

   }

   @ObfuscatedName("nw")
   @ObfuscatedSignature(
      descriptor = "(I)V",
      garbageValue = "1084362169"
   )
   static final void method4214_base() {
      Client.field747 = Client.cycleCntr;
   }
}
