20 package net.sf.gridarta.model.anim;
22 import java.util.ArrayList;
23 import java.util.List;
26 import org.apache.log4j.Category;
27 import org.apache.log4j.Logger;
28 import org.jetbrains.annotations.NotNull;
52 private final List<String>
frames =
new ArrayList<>();
99 if (line.startsWith(
"facings ")) {
100 tmpFacings = Integer.parseInt(line.substring(8));
104 if (tmpFacings < 1) {
105 LOG.warn(
"Ignoring invalid facings value: " + tmpFacings);
109 boolean first =
true;
111 if (first && line.startsWith(
"facings ")) {
118 LOG.warn(
"Animation " +
animName +
" has no frames");
119 for (
int i = 0; i <
facings; i++) {
172 for (
int facing = 1; facing <
facings; facing++) {
174 if (!frame.startsWith(
"dummy.")) {
195 private String
getFrame(
final int facing,
final int frame)
throws IndexOutOfBoundsException {
196 if (facing < 0 || facing >=
facings) {
197 throw new IndexOutOfBoundsException(
"Invalid facing " + facing +
" (anim only has " +
facings +
" facings)");
200 throw new IndexOutOfBoundsException(
"Invalid frame " + frame +
" (anim only has " +
frameCount +
" frames)");