Esempio n. 1
0
  public static int getKillCount(Thing t) {
    HashMap hm = getKillHashMap();
    Integer i = (Integer) hm.get(t.name());

    if (i == null) return 0;
    return i.intValue();
  }
Esempio n. 2
0
  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;
  }