Ejemplo 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();
  }
Ejemplo 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;
  }