import org.hedgecode.chess.img.ImageFilter;
/**
- *
+ * Loader for chess piece's set of images.
*
* @author Dmitry Samoshin aka gotty
*/
if (Type.STATELESS.equals(loadType()) || !pieceSetMap.containsKey(name)) {
String piecePath = FilenameUtils.getFullPath(PIECES_DIR, name);
pieceSet = loadPieces(piecePath);
- if (Type.STATEFUL.equals(loadType()) && pieceSet != null) {
+ if (Type.STATEFUL.equals(loadType())) {
pieceSetMap.put(name, pieceSet);
}
} else {
images.get(name)
);
}
- return pieceSet.isFull()
- ? pieceSet
- : null; // todo: ImageException
+ if (!pieceSet.isFilled()) {
+ throw new ImageException("image.incomplete.piece.set", piecePath);
+ }
+ return pieceSet;
}
}