예제 #1
0
        //-------------------------------------------------------------------------
        void _loadTaskData()
        {
            ListMonsterData.Clear();

            foreach (var i in TbDataTaskKillMonster.ListMonster)
            {
                OneMonsterData one_monster_data = new OneMonsterData();
                one_monster_data.monster_id = i.monster_id;
                one_monster_data.num_cur    = 0;
                one_monster_data.num_total  = i.count;

                ListMonsterData.Add(one_monster_data);
            }

            string data = null;

            if (TaskData.task_data.TryGetValue(0, out data))
            {
                int      index     = 0;
                string[] list_data = data.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                while (index < list_data.Length)
                {
                    int monster_id = int.Parse(list_data[index++]);
                    int num_cur    = int.Parse(list_data[index++]);

                    foreach (var j in ListMonsterData)
                    {
                        if (j.monster_id == monster_id)
                        {
                            j.num_cur = num_cur;
                            break;
                        }
                    }
                }
            }
        }
예제 #2
0
        //-------------------------------------------------------------------------
        void _loadTaskData()
        {
            ListMonsterData.Clear();

            foreach (var i in TbDataTaskKillMonster.ListMonster)
            {
                OneMonsterData one_monster_data = new OneMonsterData();
                one_monster_data.monster_id = i.monster_id;
                one_monster_data.num_cur = 0;
                one_monster_data.num_total = i.count;

                ListMonsterData.Add(one_monster_data);
            }

            string data = null;
            if (TaskData.task_data.TryGetValue(0, out data))
            {
                int index = 0;
                string[] list_data = data.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
                while (index < list_data.Length)
                {
                    int monster_id = int.Parse(list_data[index++]);
                    int num_cur = int.Parse(list_data[index++]);

                    foreach (var j in ListMonsterData)
                    {
                        if (j.monster_id == monster_id)
                        {
                            j.num_cur = num_cur;
                            break;
                        }
                    }
                }
            }
        }