update getImageType() to work only with IRenderableCard.
parent
18afab644e
commit
7d893ff28d
|
@ -140,4 +140,8 @@ public interface IRenderableCard {
|
|||
default long getRenderKey() {
|
||||
return getCardDefinition().getDistinctName().hashCode();
|
||||
}
|
||||
|
||||
default boolean isUnknown() {
|
||||
return getCardDefinition() == MagicCardDefinition.UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -278,9 +278,7 @@ public final class MagicImages {
|
|||
|
||||
private static ImageType getImageType(IRenderableCard face) {
|
||||
|
||||
final MagicCardDefinition cdef = face.getCardDefinition();
|
||||
|
||||
if (cdef == MagicCardDefinition.UNKNOWN) {
|
||||
if (face.isUnknown()) {
|
||||
return ImageType.UNKNOWN;
|
||||
}
|
||||
|
||||
|
@ -292,11 +290,12 @@ public final class MagicImages {
|
|||
return ImageType.PROXY;
|
||||
}
|
||||
|
||||
if (GeneralConfig.getInstance().getImagesOnDemand() && !MagicFileSystem.getCardImageFile(cdef).exists()) {
|
||||
if (GeneralConfig.getInstance().getImagesOnDemand()
|
||||
&& !MagicFileSystem.getCardImageFile(face).exists()) {
|
||||
return ImageType.FULL;
|
||||
}
|
||||
|
||||
if (MagicFileSystem.getCardImageFile(cdef).exists()) {
|
||||
if (MagicFileSystem.getCardImageFile(face).exists()) {
|
||||
return ImageType.FULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -141,6 +141,10 @@ public final class MagicFileSystem {
|
|||
return new File(imageDirectory.toFile(), getImageFilename(card));
|
||||
}
|
||||
|
||||
public static File getCardImageFile(IRenderableCard face) {
|
||||
return getCardImageFile(face.getCardDefinition());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a File object representing the given card's cropped image file.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue