package mapped;

import net.runelite.api.Nameable;
import net.runelite.api.clan.ClanRank;
import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.api.RSClanChannelMember;
import net.runelite.rs.api.RSUsername;

@ObfuscatedName("ft")
public class ClanChannelMember implements RSClanChannelMember {
   @ObfuscatedName("at")
   public byte rank;
   @ObfuscatedName("ah")
   @ObfuscatedGetter(
      intValue = 55866297
   )
   public int world;
   @ObfuscatedName("ar")
   @ObfuscatedSignature(
      descriptor = "Lvj;"
   )
   public Username username;

   public int compareTo(Nameable var1) {
      return this.getName().compareTo(var1.getName());
   }

   public String getName() {
      return this.getUsername().getName();
   }

   public RSUsername getUsername() {
      return this.username;
   }

   public byte getRSRank() {
      return this.rank;
   }

   public String getPrevName() {
      return null;
   }

   public ClanRank getRank() {
      return SpriteMask.client.getClanRankFromRs(this.getRSRank());
   }

   public int getWorld() {
      return this.world;
   }

   @ObfuscatedName("as")
   @ObfuscatedSignature(
      descriptor = "(ILdt;ZI)I",
      garbageValue = "-1206628329"
   )
   static int method3248(int var0, Script var1, boolean var2) {
      Widget var3 = var2?Interpreter.scriptDotWidget:HealthBar.scriptActiveWidget;
      if(var0 == 1500) {
         Interpreter.Interpreter_intStack[++DbTableType.Interpreter_intStackSize - 1] = var3.x;
         return 1;
      } else if(var0 == 1501) {
         Interpreter.Interpreter_intStack[++DbTableType.Interpreter_intStackSize - 1] = var3.y;
         return 1;
      } else if(var0 == 1502) {
         Interpreter.Interpreter_intStack[++DbTableType.Interpreter_intStackSize - 1] = var3.width;
         return 1;
      } else if(var0 == 1503) {
         Interpreter.Interpreter_intStack[++DbTableType.Interpreter_intStackSize - 1] = var3.height;
         return 1;
      } else if(var0 == 1504) {
         Interpreter.Interpreter_intStack[++DbTableType.Interpreter_intStackSize - 1] = var3.isHidden?1:0;
         return 1;
      } else if(var0 == 1505) {
         Interpreter.Interpreter_intStack[++DbTableType.Interpreter_intStackSize - 1] = var3.parentId;
         return 1;
      } else {
         return 2;
      }
   }
}
