Class StateTransitionsRepository
java.lang.Object
io.github.jspinak.brobot.services.StateTransitionsRepository
Manages the StateTransitions repository and retrieves
StateTransitions given a state name.
-
Constructor Summary
ConstructorsConstructorDescriptionStateTransitionsRepository
(StateTransitionsJointTable stateTransitionsJointTable) -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(StateTransitions stateTransitions) void
Returns a StateTransitions object given a state id.Returns a set of all StateTransitions objects in the repository with state ids.Returns all StateTransition objects, including ToTransitions.getRepo()
void
This method is called after all states have been initialized with ids.void
print()
-
Constructor Details
-
StateTransitionsRepository
-
-
Method Details
-
add
-
populateStateTransitionsJointTable
public void populateStateTransitionsJointTable()This method is called after all states have been initialized with ids. Each transition can activate multiple states. All pairs of (originating state/activated state) are added to the joint table. -
get
Returns a StateTransitions object given a state id.- Parameters:
stateId
- the id of the state to find.- Returns:
- an Optional containing the StateTransitions object if found, or an empty Optional if not found.
-
getAllStateIds
Returns a set of all StateTransitions objects in the repository with state ids.- Returns:
- a set of state ids for all StateTransitions with ids.
-
getAllTransitions
Returns all StateTransition objects, including ToTransitions.- Returns:
- a list of StateTransition objects in the model.
-
getAllStateTransitionsAsCopy
-
emptyRepos
public void emptyRepos() -
print
public void print() -
getRepo
-
getStateTransitionsJointTable
-