Beispiel #1
0
    // 先從資料表讀進來
    void LoadFromFile()
    {
        string      strTableName = "npc";
        StaticTable Table        = StaticTableMgr.ReadTable(strTableName);

        m_dictNPC = Table.GetData();
        // 把 Cache 給清掉
        StaticTableMgr.ClearCache(strTableName);
    }
Beispiel #2
0
    // 先從資料表讀進來
    void LoadFromFile()
    {
        if (m_dictItem == null)
        {
            m_dictItem = new Dictionary <string, Dictionary <string, string> >();
        }
        // 做清空的動作
        m_dictItem.Clear();
        List <string> listTable = new List <string> {
            "item_gem", "item_general"
        };

        foreach (string strTableName in listTable)
        {
            StaticTable Table = StaticTableMgr.ReadTable(strTableName);
            // 一張一張做載入的動作
            m_dictItem = Utility.DictUnionDict <Dictionary <string, string> >(m_dictItem, Table.GetData());
            // 把 Cache 給清掉
            StaticTableMgr.ClearCache(strTableName);
        }
    }