}
return genericEmergencyAnimation;
}
public static Animation getEmergencyAnimation(EmergencyType emergencyType, Integer numberOfPeople) {
Animation emergencyAnimation = new Animation();
emergencyAnimation.setLooping(true);
emergencyAnimation.setAutoUpdate(true);
for (int row = 0; row < getEmergencySpriteSheet(emergencyType).getHorizontalCount(); row++) {
for (int frame = 0; frame < getEmergencySpriteSheet(emergencyType).getVerticalCount(); frame++) {
try {
Image sprite = getEmergencySpriteSheet(emergencyType).getSprite(row, frame);
if (numberOfPeople != null) {
sprite.getGraphics().drawString("" + numberOfPeople, sprite.getWidth() / 2, sprite.getHeight() / 2);
}
emergencyAnimation.addFrame(sprite, 250);
} catch (SlickException ex) {
Logger.getLogger(AnimationFactory.class.getName()).log(Level.SEVERE, null, ex);
}
}
}