Register the stat into StatList.
()
| 87 | * Register the stat into StatList. |
| 88 | */ |
| 89 | public StatBase registerStat() |
| 90 | { |
| 91 | if (StatList.oneShotStats.containsKey(this.statId)) |
| 92 | { |
| 93 | throw new RuntimeException("Duplicate stat id: \"" + StatList.oneShotStats.get(this.statId).statName + "\" and \"" + this.statName + "\" at id " + this.statId); |
| 94 | } |
| 95 | else |
| 96 | { |
| 97 | StatList.allStats.add(this); |
| 98 | StatList.oneShotStats.put(this.statId, this); |
| 99 | return this; |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * Returns whether or not the StatBase-derived class is a statistic (running counter) or an achievement (one-shot). |
no test coverage detected