1 package org.catacomb.datalish;
2
3 import java.util.HashMap;
4
5 import org.catacomb.report.E;
6
7
8 public class SpriteStore {
9
10 HashMap<String, SpriteData> sprites;
11
12
13
14 public SpriteStore() {
15 sprites = new HashMap<String, SpriteData>();
16 }
17
18
19 public void add(SpriteData sd) {
20 sprites.put(sd.getName(), sd);
21
22 }
23
24
25 public SpriteData getSprite(String sid) {
26 SpriteData ret = null;
27 if (sprites.containsKey(sid)) {
28 ret = sprites.get(sid);
29 } else {
30 E.error("no such sprite " + sid);
31 }
32 return ret;
33 }
34
35
36
37 }