@Override public int getFile() { return getFile(); } }
@Override public int getSequence() { return getSequence(); }
@Override public EImageLinkType getType() { return getType(); }
/** * Converts a given name to an image link. * <p> * Names can either be direct names of the png files or they can have the for "original_<file>_<type>_<sequence * * @param name * The name. * @param imageIndex * The index in the sequence. * @return The image link for that image, no matter if it exists or not. */ public static ImageLink fromName(String name, int imageIndex) { Matcher matcher = ORIGINAL_LINK.matcher(name); if (matcher.matches()) { EImageLinkType type = EImageLinkType.valueOf(matcher.group(ORIGINAL_LINK_TYPE)); int file = Integer.parseInt(matcher.group(ORIGINAL_LINK_FILE)); int sequence = Integer.parseInt(matcher.group(ORIGINAL_LINK_SEQUENCE)); return new OriginalImageLink(type, file, sequence, imageIndex); } else { return new DirectImageLink(name + "." + imageIndex); } }
private Image getDirectImage(DirectImageLink link) { if (indexFile == null) { indexFile = new ImageIndexFile(); } int index = TextureMap.getIndex(link.getName()); return indexFile.getImage(index); }