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

        m_dictNPC = Table.GetData();
        // 把 Cache 給清掉
        StaticTableMgr.ClearCache(strTableName);
    }
Пример #2
0
    // 讀檔案
    public static StaticTable ReadTable(string strFilename)
    {
        if (m_dictMap.ContainsKey(strFilename) == true)
        {
            return(m_dictMap[strFilename]);
        }
        StaticTable Table = new StaticTable(strFilename);

        m_dictMap[strFilename] = Table;
        return(m_dictMap[strFilename]);
    }
Пример #3
0
    // 先從資料表讀進來
    void LoadFromFile()
    {
        StaticTable   Table    = StaticTableMgr.ReadTable("levelexp");
        List <string> listKeys = Table.GetKeys();

        foreach (string strKey in listKeys)
        {
            m_dictLevelExp[strKey] = System.Convert.ToInt32(Table.Get(strKey, "Exp"));
        }
        // 把 Cache 給清掉
        StaticTableMgr.ClearCache("levelexp");
    }
Пример #4
0
    // 先從資料表讀進來
    void LoadFromFile()
    {
        // 清掉設定檔
        m_dictConfigMap.Clear();
        string      strTableName = "config";
        StaticTable Table        = StaticTableMgr.ReadTable(strTableName);
        // 一個一個值讀進來
        List <string> listKey = Table.GetKeys();

        foreach (var Key in listKey)
        {
            string strKey   = Table.Get(Key, "ID");
            string strValue = Table.Get(Key, "Value");
            m_dictConfigMap[strKey] = strValue;
        }
        // 把 Cache 給清掉
        StaticTableMgr.ClearCache(strTableName);
    }
Пример #5
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);
        }
    }