Class SimpleCaptchaBank

java.lang.Object
com.csse3200.game.components.computerterminal.SimpleCaptchaBank

public class SimpleCaptchaBank extends Object
Minimal in-memory collection of CAPTCHA specifications. Intended to be constructed at UI creation time and populated with spritesheet. Selection is random.
  • Constructor Details

    • SimpleCaptchaBank

      public SimpleCaptchaBank()
  • Method Details

    • add

      Adds a spec to the bank.
      Parameters:
      spec - specification to add
      Returns:
      this bank for chaining
    • random

      public CaptchaSpecLike random(Random rng)
      Returns a random spec from the bank. Throws if no specs have been added.
      Parameters:
      rng - random source
      Returns:
      chosen spec
      Throws:
      IllegalStateException - if the bank is empty