public static int getKillCount(Thing t) { HashMap hm = getKillHashMap(); Integer i = (Integer) hm.get(t.name()); if (i == null) return 0; return i.intValue(); }
public static int incKillCount(Thing t) { HashMap hm = getKillHashMap(); String name = t.name(); Integer i = (Integer) hm.get(name); if (i == null) { i = new Integer(0); } int newKillCount = i.intValue() + 1; hm.put(name, new Integer(newKillCount)); return newKillCount; }