package mapped;

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

@ObfuscatedName("rv")
public class Bounds implements RSBounds {
   @ObfuscatedName("at")
   @ObfuscatedGetter(
      intValue = 174589721
   )
   public int lowX;
   @ObfuscatedName("ah")
   @ObfuscatedGetter(
      intValue = 1766053499
   )
   public int lowY;
   @ObfuscatedName("ar")
   @ObfuscatedGetter(
      intValue = 1385823071
   )
   public int highX;
   @ObfuscatedName("ao")
   @ObfuscatedGetter(
      intValue = -453294997
   )
   public int highY;

   public Bounds(int var1, int var2, int var3, int var4) {
      this.setLow_base(var1, var2);
      this.setHigh_base(var3, var4);
   }

   public Bounds(int var1, int var2) {
      this(0, 0, var1, var2);
   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(IIB)V",
      garbageValue = "20"
   )
   public void setLow_base(int var1, int var2) {
      this.lowX = var1;
      this.lowY = var2;
   }

   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "(III)V",
      garbageValue = "-1923662926"
   )
   public void setHigh_base(int var1, int var2) {
      this.highX = var1;
      this.highY = var2;
   }

   @ObfuscatedName("ar")
   @ObfuscatedSignature(
      descriptor = "(III)Z",
      garbageValue = "375775673"
   )
   public boolean method8373_base(int var1, int var2) {
      return var1 >= this.lowX && var1 < this.highX + this.lowX && var2 >= this.lowY && var2 < this.highY + this.lowY;
   }

   @ObfuscatedName("ao")
   @ObfuscatedSignature(
      descriptor = "(Lrv;Lrv;I)V",
      garbageValue = "-1398838147"
   )
   public void method8377(Bounds var1, Bounds var2) {
      this.method8378(var1, var2);
      this.method8379(var1, var2);
   }

   @ObfuscatedName("ab")
   @ObfuscatedSignature(
      descriptor = "(Lrv;Lrv;I)V",
      garbageValue = "497587597"
   )
   void method8378(Bounds var1, Bounds var2) {
      var2.lowX = this.lowX;
      var2.highX = this.highX;
      if(this.lowX < var1.lowX) {
         var2.highX -= var1.lowX - this.lowX;
         var2.lowX = var1.lowX;
      }

      if(var2.method8389_base() > var1.method8389_base()) {
         var2.highX -= var2.method8389_base() - var1.method8389_base();
      }

      if(var2.highX < 0) {
         var2.highX = 0;
      }

   }

   @ObfuscatedName("au")
   @ObfuscatedSignature(
      descriptor = "(Lrv;Lrv;I)V",
      garbageValue = "1262928810"
   )
   void method8379(Bounds var1, Bounds var2) {
      var2.lowY = this.lowY;
      var2.highY = this.highY;
      if(this.lowY < var1.lowY) {
         var2.highY -= var1.lowY - this.lowY;
         var2.lowY = var1.lowY;
      }

      if(var2.method8379_base() > var1.method8379_base()) {
         var2.highY -= var2.method8379_base() - var1.method8379_base();
      }

      if(var2.highY < 0) {
         var2.highY = 0;
      }

   }

   @ObfuscatedName("aa")
   @ObfuscatedSignature(
      descriptor = "(I)I",
      garbageValue = "-222138556"
   )
   int method8389_base() {
      return this.lowX + this.highX;
   }

   @ObfuscatedName("ac")
   @ObfuscatedSignature(
      descriptor = "(I)I",
      garbageValue = "578775229"
   )
   int method8379_base() {
      return this.lowY + this.highY;
   }

   public String toString() {
      return null;
   }
}
