示例#1
0
        /// <summary>
        /// 通过id获取英雄数据
        /// </summary>
        /// <param name="heroId"></param>
        /// <returns></returns>
        public static HeroModel GetHeroData(int heroId)
        {
            HeroModel hero = null;

            HeroDict.TryGetValue(heroId, out hero);
            return(hero);
        }
示例#2
0
        /// <summary>
        /// 创建英雄
        /// </summary>
        public static void createHero(int typeId, string name, int baseAttack, int baseDefense, int hp, int mp, double speed,
                                      int growAttack, int growDefense, int growHp, int growMp, double attackDistance, double attackInterval)
        {
            HeroModel hero = new HeroModel(typeId, name, baseAttack, baseDefense, hp,
                                           mp, speed, growAttack, growDefense, growHp, growMp, attackDistance, attackInterval);

            HeroDict.Add(hero.TypeId, hero);
        }