Class StateGenerator
java.lang.Object
ubc.team09.state.StateGenerator
This class is used to iterate over child states, generating them on demand.
E.g.,
StateGenerator iter = new StateGenerator(state);
for (
State child = iter.next();
child != null;
child = iter.next()
) {
// Do something with the `child` state...
}
Rather than using the constructor, you can also get a state generator via
the State.children() method.-
Constructor Summary
ConstructorsConstructorDescriptionStateGenerator(State parent) Creates a new generator to iterate over the children of a given game state. -
Method Summary
-
Constructor Details
-
StateGenerator
Creates a new generator to iterate over the children of a given game state. Typically you should useState.children()instead of calling this constructor directly.
-
-
Method Details
-
next
Yields the next child state. If all child states have been exhausted, then this will returnnull.
-