package mapped;

import java.security.SecureRandom;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import net.runelite.mapping.ObfuscatedGetter;
import net.runelite.mapping.ObfuscatedName;
import net.runelite.mapping.ObfuscatedSignature;
import net.runelite.rs.api.RSSecureRandomFuture;

@ObfuscatedName("cd")
public class SecureRandomFuture implements RSSecureRandomFuture {
   @ObfuscatedName("kh")
   @ObfuscatedGetter(
      intValue = -705746665
   )
   static int cameraY;
   @ObfuscatedName("at")
   ExecutorService executor;
   @ObfuscatedName("ah")
   Future future;

   SecureRandomFuture() {
      this.executor = Executors.newSingleThreadExecutor();
      this.future = this.executor.submit(new SecureRandomCallable());
   }

   @ObfuscatedName("at")
   @ObfuscatedSignature(
      descriptor = "(I)V",
      garbageValue = "-55292502"
   )
   void shutdown_base() {
      this.executor.shutdown();
      this.executor = null;
   }

   @ObfuscatedName("ah")
   @ObfuscatedSignature(
      descriptor = "(B)Z",
      garbageValue = "20"
   )
   boolean isDone_base() {
      return this.future.isDone();
   }

   @ObfuscatedName("ar")
   @ObfuscatedSignature(
      descriptor = "(I)Ljava/security/SecureRandom;",
      garbageValue = "694331827"
   )
   SecureRandom get_base() {
      SecureRandom var10000;
      try {
         var10000 = (SecureRandom)this.future.get();
      } catch (Exception var4) {
         SecureRandom var3 = new SecureRandom();
         var3.nextInt();
         return var3;
      }

      return var10000;
   }
}
