Class SwitchResult
java.lang.Object
privbot.mechanics.SwitchResult
What one
ctx.loadouts.switchTo(..) call sent. Immutable.
What it proves: only which clicks went out (were accepted by the dispatcher) in that call. Nothing here says a
piece is on; verify on later ticks with SwitchCheck.
sent(): the setup entries (by name) whose Wield/Wear/Equip click was accepted;notCarried(): missing entries with no carried item by id or, failing that, by name;failed(): entries whose click was refused or threw, or whose item has no wear action;byName(): entries matched by name because no carried item had the setup's id, as"wanted -> carried";unreadable(): equipment, inventory, or a name needed for matching could not be read, so nothing was sent and the lists are empty (never "nothing missing").
Pure data: safe on any thread.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanallSent()byName()failed()static SwitchResultreason()sent()toString()booleanstatic SwitchResultunreadable(String reason) The setup to verify: accepted name-matched clicks use the selected item's actual id in its intended slot.
-
Constructor Details
-
SwitchResult
public SwitchResult(List<String> sent, List<String> notCarried, List<String> failed, List<String> byName, boolean unreadable) - Parameters:
sent- entries whose click was acceptednotCarried- entries not carriedfailed- entries whose click was refused or threwbyName- name-matched entries,"wanted -> carried"unreadable- whether the reads failed (then nothing was sent)
-
-
Method Details
-
unreadable
- Parameters:
reason- why the reads failed- Returns:
- an unreadable result: nothing sent
-
nothingToSend
- Returns:
- a readable result with nothing to send
-
sent
-
notCarried
-
failed
-
byName
-
verificationSetup
The setup to verify: accepted name-matched clicks use the selected item's actual id in its intended slot. Unsent entries keep their original requirement, so a partial switch cannot appear complete. Null for an unreadable result or a result constructed without a setup. -
unreadable
public boolean unreadable()- Returns:
- true when the reads failed and nothing was sent
-
reason
- Returns:
- why the reads failed; empty for a readable result
-
allSent
public boolean allSent()- Returns:
- true when the reads worked and every missing entry's click went out
-
toString
-