Exemple #1
0
        public HeroTable Get(int iID)
        {
            HeroTable rkRet = null;

            if (!m_kMapDatas.TryGetValue(iID, out rkRet))
            {
                return(null);
            }
            return(rkRet);
        }
Exemple #2
0
        public bool Load(string text)
        {
            JsonData jsonData = JsonMapper.ToObject(text);

            for (int i = 0; i < jsonData.Count; i++)
            {
                JsonData  data          = jsonData[i];
                HeroTable TableInstance = new HeroTable();
                JsonData  tempID        = data["ID"];
                TableInstance.ID = int.Parse(tempID.ToString());
                JsonData tempName = data["Name"];
                TableInstance.Name = tempName.ToString();
                JsonData tempModle = data["Modle"];
                TableInstance.Modle = int.Parse(tempModle.ToString());
                JsonData tempDescribe = data["Describe"];
                TableInstance.Describe = tempDescribe.ToString();
                JsonData tempHp = data["Hp"];
                TableInstance.Hp = int.Parse(tempHp.ToString());
                JsonData tempHpincre = data["Hpincre"];
                TableInstance.Hpincre = int.Parse(tempHpincre.ToString());
                JsonData tempAttack = data["Attack"];
                TableInstance.Attack = int.Parse(tempAttack.ToString());
                JsonData tempSuper = data["Super"];
                TableInstance.Super = int.Parse(tempSuper.ToString());
                JsonData tempSpeed = data["Speed"];
                TableInstance.Speed = int.Parse(tempSpeed.ToString());
                JsonData tempShoot = data["Shoot"];
                TableInstance.Shoot = int.Parse(tempShoot.ToString());
                JsonData tempTime = data["Time"];
                TableInstance.Time = int.Parse(tempTime.ToString());
                ////////////////////
                m_kDatas.Add(TableInstance);
                m_kMapDatas.Add(TableInstance.ID, TableInstance);
            }

            return(true);
        }