void CGameCounter::Spawn(void) { // Save off the initial count SetInitialValue(CountValue()); CRulePointEntity::Spawn(); }
/** Debugging function, counts number of occurrences of an element regardless of its correct position in the tree */ size_t CountValue(const T &element, size_t node_idx) const { if (node_idx == INVALID_NODE) return 0; const node &n = this->nodes[node_idx]; return CountValue(element, n.left) + CountValue(element, n.right) + ((n.element == element) ? 1 : 0); }
inline BOOL HitLimit(void) { return CountValue() == LimitValue(); }