23 package com.realtime.crossfire.jxclient.map;
25 import java.util.HashMap;
26 import java.util.HashSet;
28 import org.jetbrains.annotations.NotNull;
29 import org.jetbrains.annotations.Nullable;
43 private final Map<Location, AnimationState>
animations =
new HashMap<>();
60 animationState.allocate(location);
67 public void remove(@NotNull
final Location location) {
78 if (animationState ==
null) {
79 System.err.println(
"No animation at "+location+
" to update animation speed.");
93 public void scroll(
final int dx,
final int dy,
final int width,
final int height) {
94 final Iterable<AnimationState> tmp =
new HashSet<>(
animations.values());
97 animationState.scroll(dx, dy, width, height);
98 for (
Location location : animationState) {
111 if (animationState !=
null) {
112 animationState.free(location);