@@ -0,0 +1,2563 @@
+package hu.kazocsaba.gamecracker.game;%0A%0Aimport java.util.Iterator;%0A%0A/**%0A * A sequence of valid moves from an initial position (not necessarily the %7B@link Game#getInitialPosition() game's%0A * initial position%7D).%0A * %0A * @param %3CP%3E the concrete Position type%0A * @param %3CM%3E the concrete Move type%0A * @param %3CT%3E the concrete Transformation type%0A * @author Kaz%C3%B3 Csaba%0A */%0Apublic interface Match%3CP extends Position%3CP,M,T%3E, M extends Move%3CM,T%3E, T extends Transformation%3CT%3E%3E extends Iterable%3CMatch.Point%3CP,M,T%3E%3E %7B%0A%09/**%0A%09 * A point in the history of a match. Each point corresponds to a position, and identifies the move%0A%09 * made from that position, except for the last point, where the move is %7B@code null%7D.%0A%09 * %3Cp%3E%0A%09 * Instances of this class can be obtained from %7B@link Match#iterator()%7D, and are only valid for the%0A%09 * duration of the iteration. The behavior of a match point is undefined if the match has been modified after%0A%09 * the point is returned by the iterator.%0A%09 * %0A%09 * @param %3CP%3E the concrete Position type%0A%09 * @param %3CM%3E the concrete Move type%0A%09 * @param %3CT%3E the concrete Transformation type%0A%09 */%0A%09public interface Point%3CP extends Position%3CP,M,T%3E, M extends Move%3CM,T%3E, T extends Transformation%3CT%3E%3E %7B%0A%09%09/**%0A%09%09 * Returns the position at this point.%0A%09%09 * %0A%09%09 * @return the position%0A%09%09 */%0A%09%09public P getPosition();%0A%09%09/**%0A%09%09 * Returns the move made from this position, or %7B@code null%7D if this is the current position of the match.%0A%09%09 * %0A%09%09 * @return the move, or %7B@code null%7D if this is the last point of the match%0A%09%09 */%0A%09%09public M getMove();%0A%09%7D%0A%09/**%0A%09 * Returns the current (last) position of the match. This position is never null; if the match contains%0A%09 * no moves, then the initial position is returned.%0A%09 * %0A%09 * @return the current position%0A%09 */%0A%09public P getPosition();%0A%09/**%0A%09 * Applies a move in the current position, and updates the match accordingly.%0A%09 * %0A%09 * @param move the move to make%0A%09 * @throws IllegalArgumentException if %7B@code move%7D is not one of the moves returned by %7B@code getPosition().getMoves()%7D%0A%09 */%0A%09public void move(M move);%0A%09%0A%09/**%0A%09 * Undoes the last move, returning the match to the previous position.%0A%09 * %0A%09 * @throws IllegalStateException if the match contains no moves%0A%09 */%0A%09public void back();%0A%09%0A%09/**%0A%09 * Returns an unmodifiable iterator over the history of the match. The iterator is never empty:%0A%09 * the first element corresponds to the initial position of the match, and the last element contains%0A%09 * the current position.%0A%09 * %0A%09 * @return an iterator over the match%0A%09 */%0A%09@Override%0A%09public Iterator%3CPoint%3CP,M,T%3E%3E iterator();%0A%7D%0A

Add Match API.