package mapped;

import java.awt.Component;
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.api.RSMouseWheelHandler;

@ObfuscatedName("ae")
public final class MouseWheelHandler implements class212, MouseWheelListener, RSMouseWheelHandler {
   @ObfuscatedName("at")
   @ObfuscatedGetter(
      intValue = 1014752237
   )
   int rotation;

   MouseWheelHandler() {
      this.rotation = 0;
   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(Ljava/awt/Component;I)V",
      garbageValue = "1307188378"
   )
   void addTo_base(Component var1) {
      var1.addMouseWheelListener(this);
   }

   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "(Ljava/awt/Component;B)V",
      garbageValue = "72"
   )
   void method306_base(Component var1) {
      var1.removeMouseWheelListener(this);
   }

   @ObfuscatedName("ar")
   @ObfuscatedSignature(
      descriptor = "(I)I",
      garbageValue = "-855152300"
   )
   public synchronized int useRotation_base() {
      int var1 = this.rotation;
      this.rotation = 0;
      return var1;
   }

   public synchronized void copy$mouseWheelMoved(MouseWheelEvent var1) {
      this.rotation += var1.getWheelRotation();
   }

   public synchronized void mouseWheelMoved(MouseWheelEvent var1) {
      var1 = SpriteMask.client.getCallbacks().mouseWheelMoved(var1);
      if(!var1.isConsumed()) {
         this.copy$mouseWheelMoved(var1);
      }

   }
}
