Class SimpleCaptchaBank
java.lang.Object
com.csse3200.game.components.computerterminal.SimpleCaptchaBank
Minimal in-memory collection of CAPTCHA specifications.
Intended to be constructed at UI creation time and populated with
spritesheet. Selection is random.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(CaptchaSpecLike spec) Adds a spec to the bank.Returns a random spec from the bank.
-
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
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
-