package mapped;

import net.runelite.api.clan.ClanMember;
import net.runelite.api.clan.ClanRank;
import net.runelite.mapping.Export;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.api.RSRuneLiteClanMember;

public class RuneLiteClanMember implements ClanMember, RSRuneLiteClanMember {
   @Export("idx")
   @ObfuscatedName("idx")
   public final int field5305;
   @Export("clanSettings")
   @ObfuscatedSignature(
      descriptor = "Lfc;"
   )
   public final ClanSettings clanSettings;

   @ObfuscatedSignature(
      descriptor = "(Lfc;I)V"
   )
   public RuneLiteClanMember(ClanSettings var1, int var2) {
      this.clanSettings = var1;
      this.field5305 = var2;
   }

   @Export("getName")
   public String getName() {
      return this.clanSettings.memberNames[this.field5305];
   }

   @Export("instanceOf")
   public boolean instanceOf(Object var1) {
      return var1 instanceof RuneLiteClanMember;
   }

   @Export("getRank")
   public ClanRank getRank() {
      return this.getClanRank(this.clanSettings.memberRanks[this.field5305]);
   }

   @Export("getClanRank")
   public ClanRank getClanRank(int var1) {
      switch(var1) {
      case -1:
         return ClanRank.GUEST;
      case 10:
         return ClanRank.CLAN_RANK_2;
      case 20:
         return ClanRank.CLAN_RANK_3;
      case 30:
         return ClanRank.CLAN_RANK_4;
      case 40:
         return ClanRank.CLAN_RANK_5;
      case 50:
         return ClanRank.CLAN_RANK_6;
      case 60:
         return ClanRank.CLAN_RANK_7;
      case 70:
         return ClanRank.CLAN_RANK_8;
      case 80:
         return ClanRank.CLAN_RANK_9;
      case 90:
         return ClanRank.CLAN_RANK_10;
      case 100:
         return ClanRank.ADMINISTRATOR;
      case 105:
         return ClanRank.CLAN_RANK_11;
      case 110:
         return ClanRank.CLAN_RANK_12;
      case 115:
         return ClanRank.CLAN_RANK_13;
      case 120:
         return ClanRank.CLAN_RANK_14;
      case 125:
         return ClanRank.DEPUTY_OWNER;
      case 126:
         return ClanRank.OWNER;
      case 127:
         return ClanRank.JMOD;
      default:
         return ClanRank.CLAN_RANK_1;
      }
   }

   @Export("equals")
   public boolean equals(Object var1) {
      if(this == var1) {
         return true;
      } else if(!(var1 instanceof RuneLiteClanMember)) {
         return false;
      } else {
         RuneLiteClanMember var2 = (RuneLiteClanMember)var1;
         if(!var2.instanceOf(this)) {
            return false;
         } else {
            String var3 = this.getName();
            String var4 = var2.getName();
            if(var3 == null) {
               if(var4 != null) {
                  return false;
               }
            } else if(!var3.equals(var4)) {
               return false;
            }

            ClanRank var5 = this.getRank();
            ClanRank var6 = var2.getRank();
            if(var5 == null) {
               if(var6 != null) {
                  return false;
               }
            } else if(!var5.equals(var6)) {
               return false;
            }

            return true;
         }
      }
   }

   @Export("hashCode")
   public int hashCode() {
      byte var1 = 1;
      String var2 = this.getName();
      int var3 = var1 * 59 + (var2 == null?43:var2.hashCode());
      ClanRank var4 = this.getRank();
      var3 = var3 * 59 + (var4 == null?43:var4.hashCode());
      return var3;
   }

   @Export("toString")
   public String toString() {
      return "ClanMemberImpl(getName=" + this.getName() + ", getRank=" + this.getRank() + ")";
   }
}
