Beispiel #1
0
        public static HeroDataModel GetHeroData(int heroId)
        {
            HeroDataModel dataModel = null;

            idModelDict.TryGetValue(heroId, out dataModel);
            return(dataModel);
        }
Beispiel #2
0
        /// <summary>
        /// 创建英雄
        /// </summary>
        /// <param name="id"></param>
        /// <param name="name"></param>
        /// <param name="baseAttack"></param>
        /// <param name="baseDefens"></param>
        /// <param name="hp"></param>
        /// <param name="mp"></param>
        /// <param name="growAttack"></param>
        /// <param name="growDefens"></param>
        /// <param name="growHp"></param>
        /// <param name="growMp"></param>
        /// <param name="attackDistance"></param>
        /// <param name="skillIds"></param>
        /// <returns></returns>
        private static void CreateHero(int id, string name, int baseAttack, int baseDefens, int hp, int mp, int growAttack, int growDefens, int growHp, int growMp, double attackDistance, int[] skillIds)
        {
            HeroDataModel heroData = new HeroDataModel(id, name, baseAttack, baseDefens, hp, mp, growAttack, growDefens, growHp, growMp, attackDistance, skillIds);

            //保存英雄数据
            idModelDict.Add(heroData.TypeId, heroData);
        }
Beispiel #3
0
        /// <summary>
        /// 创建英雄
        /// </summary>
        /// <returns></returns>
        public static void createHero(int id, string name, int baseAttack, int baseDefense, int hp, int mp, int growAttack, int growDefense, int growHp, int growMp, int attackDistance, int[] skillIds)
        {
            HeroDataModel hero = new HeroDataModel(id, name, baseAttack, baseDefense, hp, mp, growAttack, growDefense, growHp, growMp, attackDistance, skillIds);

            //保存英雄数据
            idModelDict.Add(hero.TypeId, hero);
        }