package mapped;

import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;

@ObfuscatedName("pw")
public final class class402 {
   @ObfuscatedName("al")
   @ObfuscatedGetter(
      intValue = -1466470293
   )
   static int field4475;
   @ObfuscatedName("at")
   final Object field4474;
   @ObfuscatedName("ah")
   @ObfuscatedGetter(
      intValue = -775774973
   )
   int field4472;

   class402(Object var1, int var2) {
      this.field4474 = var1;
      this.field4472 = var2;
   }

   @ObfuscatedName("kh")
   @ObfuscatedSignature(
      descriptor = "(ILjava/lang/String;B)V",
      garbageValue = "-6"
   )
   static void method7472_base(int var0, String var1) {
      int var2 = Players.Players_count;
      int[] var3 = Players.Players_indices;
      boolean var4 = false;
      Username var5 = new Username(var1, class89.loginType);

      for(int var6 = 0; var6 < var2; ++var6) {
         Player var7 = Client.players[var3[var6]];
         if(var7 != null && var7 != class229.localPlayer && var7.username != null && var7.username.equals(var5)) {
            PacketBufferNode var8;
            if(var0 == 1) {
               var8 = class113.method2919(ClientPacket.OPPLAYER1, Client.packetWriter.isaacCipher);
               var8.packetBuffer.writeShort_base(var3[var6]);
               var8.packetBuffer.writeByteNeg_base(0);
               Client.packetWriter.method2867(var8);
            } else if(var0 == 4) {
               var8 = class113.method2919(ClientPacket.OPPLAYER4, Client.packetWriter.isaacCipher);
               var8.packetBuffer.writeByteSub_base(0);
               var8.packetBuffer.writeShortAdd_base(var3[var6]);
               Client.packetWriter.method2867(var8);
            } else if(var0 == 6) {
               var8 = class113.method2919(ClientPacket.OPPLAYER6, Client.packetWriter.isaacCipher);
               var8.packetBuffer.writeByteSub_base(0);
               var8.packetBuffer.writeShort_base(var3[var6]);
               Client.packetWriter.method2867(var8);
            } else if(var0 == 7) {
               var8 = class113.method2919(ClientPacket.OPPLAYER7, Client.packetWriter.isaacCipher);
               var8.packetBuffer.writeShortAddLE_base(var3[var6]);
               var8.packetBuffer.writeByteSub_base(0);
               Client.packetWriter.method2867(var8);
            }

            var4 = true;
            break;
         }
      }

      if(!var4) {
         GrandExchangeOfferUnitPriceComparator.addGameMessage_base(4, "", "Unable to find " + var1);
      }

   }
}
