Пример #1
0
        //load data
        public void Load(string jsontxt)
        {
            JsonData json = JsonMapper.ToObject(jsontxt);

            json = json["trees"];
            int count = json.Count;

            for (int i = 0; i < count; i++)
            {
                BTree    bt   = new BTree();
                JsonData data = json[i];
                bt.ReadJson(data);
                this.m_mapTree.Add(bt.m_strName, bt);
            }
        }
Пример #2
0
        //load data
        public void Load(string jsontxt, string playerId = "")
        {
            JsonData json = JsonMapper.ToObject(jsontxt);

            json = json["trees"];
            int count = json.Count;

            for (int i = 0; i < count; i++)
            {
                BTree    bt   = new BTree();
                JsonData data = json[i];
                bt.ReadJson(data);
                string tmp = playerId;
                if (!this.m_mapTree.ContainsKey(bt.m_strName + tmp))
                {
                    this.m_mapTree.Add(bt.m_strName + tmp, bt);
                }
            }
        }
 //load data
 public void Load(string jsontxt)
 {
     JsonData json = JsonMapper.ToObject(jsontxt);
     json = json["trees"];
     int count = json.Count;
     for(int i = 0 ; i<count ; i++)
     {
         BTree bt = new BTree();
         JsonData data = json[i];
         bt.ReadJson(data);
         this.m_mapTree.Add(bt.m_strName , bt);
     }
 }