/// <summary> /// 利用Category的UID来建立数据库分类系统 /// </summary> private void registerWithCategory(TezDatabaseGameItem item) { if (item.category == null) { throw new Exception(string.Format("This Item [{0}] Dont Has [Category]", item.NID)); } var item_uid = m_List.Count; item.onRegister(this.UID, item_uid); var category = item.category; for (int i = 0; i < category.count; i++) { var table_id = category[i].UID; while (table_id >= m_TableList.Count) { m_TableList.Add(null); } Table table = m_TableList[table_id]; if (table == null) { table = this.createTable(item); m_TableList[table_id] = table; } table.register(item.NID, item_uid); } m_List.Add(item); m_ContainerWithName.Add(item.NID, item_uid); }
/// <summary> /// 注册Item /// </summary> public virtual void register(TezDatabaseGameItem item) { item.onRegister(this.ID, m_ItemID++); }