package mapped;

import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.api.RSDualNodeDeque;

@ObfuscatedName("od")
public final class DualNodeDeque implements RSDualNodeDeque {
   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "Lsn;"
   )
   DualNode sentinel;

   public DualNodeDeque() {
      this.sentinel = new DualNode();
      this.sentinel.previousDual = this.sentinel;
      this.sentinel.nextDual = this.sentinel;
   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(Lsn;)V"
   )
   public void method7217(DualNode var1) {
      if(var1.nextDual != null) {
         var1.removeDual_base();
      }

      var1.nextDual = this.sentinel.nextDual;
      var1.previousDual = this.sentinel;
      var1.nextDual.previousDual = var1;
      var1.previousDual.nextDual = var1;
   }

   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "(Lsn;)V"
   )
   public void method7215(DualNode var1) {
      if(var1.nextDual != null) {
         var1.removeDual_base();
      }

      var1.nextDual = this.sentinel;
      var1.previousDual = this.sentinel.previousDual;
      var1.nextDual.previousDual = var1;
      var1.previousDual.nextDual = var1;
   }

   @ObfuscatedName("ar")
   @ObfuscatedSignature(
      descriptor = "()Lsn;"
   )
   public DualNode method7216() {
      DualNode var1 = this.sentinel.previousDual;
      return var1 == this.sentinel?null:var1;
   }
}
