package mapped;

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

@ObfuscatedName("me")
public class SpriteMask extends DualNode implements RSSpriteMask {
   @ObfuscatedName("bk")
   public static Client client;
   @ObfuscatedName("at")
   @ObfuscatedGetter(
      intValue = 85072149
   )
   public final int width;
   @ObfuscatedName("ah")
   @ObfuscatedGetter(
      intValue = -1223275017
   )
   public final int height;
   @ObfuscatedName("ar")
   public final int[] xWidths;
   @ObfuscatedName("ao")
   public final int[] xStarts;

   SpriteMask(int var1, int var2, int[] var3, int[] var4, int var5) {
      this.width = var1;
      this.height = var2;
      this.xWidths = var3;
      this.xStarts = var4;
   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(III)Z",
      garbageValue = "1206229207"
   )
   public boolean contains_base(int var1, int var2) {
      if(var2 >= 0 && var2 < this.xStarts.length) {
         int var3 = this.xStarts[var2];
         if(var1 >= var3 && var1 <= var3 + this.xWidths[var2]) {
            return true;
         }
      }

      return false;
   }
}
