Search in sources :

Example 1 with ReadOnlyListPieces

use of common.datastore.blocks.ReadOnlyListPieces in project solution-finder by knewjade.

the class Task method call.

@Override
public List<Pair<List<Piece>, List<Result>>> call() throws Exception {
    Checkmate<Action> checkmate = obj.checkmateThreadLocal.get();
    Candidate<Action> candidate = obj.candidateThreadLocal.get();
    // 探索
    List<Pair<List<Piece>, List<Result>>> allResults = new ArrayList<>();
    for (ReadOnlyListPieces piece : targets) {
        List<Piece> pieces = piece.getPieces();
        List<Result> results = checkmate.search(obj.field, pieces, candidate, obj.maxClearLine, obj.maxDepth);
        allResults.add(new Pair<>(pieces, results));
    }
    return allResults;
}
Also used : ReadOnlyListPieces(common.datastore.blocks.ReadOnlyListPieces) Action(common.datastore.action.Action) Piece(core.mino.Piece) ArrayList(java.util.ArrayList) Pair(common.datastore.Pair) Result(common.datastore.Result)

Aggregations

Pair (common.datastore.Pair)1 Result (common.datastore.Result)1 Action (common.datastore.action.Action)1 ReadOnlyListPieces (common.datastore.blocks.ReadOnlyListPieces)1 Piece (core.mino.Piece)1 ArrayList (java.util.ArrayList)1