/** 统计一个(已脏的) */ private int countOne(int type) { RedPointConfig config; if ((config = RedPointConfig.get(type)) == null) { return(0); } int re = 0; //不为空 if (!config.children.isEmpty()) { int[] values = config.children.getValues(); for (int i = 0, len = config.children.size(); i < len; ++i) { re += get(values[i]); } } re += toCountOne(type); return(re); }
private void dirtyOne(int type, bool needEvent) { //已dirty跳过 if (_dirtyDic[type]) { return; } _dirtyDic[type] = true; if (needEvent) { GameC.player.dispatch(GameEventType.RefreshRedPoint, type); } RedPointConfig config = RedPointConfig.get(type); if (config.parentID > 0) { dirtyOne(config.parentID, needEvent); } }