Esempio n. 1
0
        public Hero(HeroConfig config, int id, Team team)
        {
            Contract.Assert(config != null, "config!=null");

            HealthPoints       = config.HealthPoints;
            MovementSpeed      = config.MovementSpeed;
            AutoAttackRange    = config.AutoAttackRange;
            AutoAttackDamage   = config.AutoAttackDamage;
            AutoAttackInterval = config.AutoAttackInterval;
            HeroType           = config.HeroType;
            Id   = id;
            Team = team;
        }
Esempio n. 2
0
        public Dictionary <HeroType, HeroConfig> GetConfigs()
        {
            var configs = new Dictionary <HeroType, HeroConfig>();

            var fighterHeroConfig = new HeroConfig()
            {
                HealthPoints       = 100,
                MovementSpeed      = 2,
                AutoAttackRange    = 2,
                AutoAttackDamage   = 5,
                AutoAttackInterval = 1,
                HeroType           = HeroType.Fighter,
            };

            configs[HeroType.Fighter] = fighterHeroConfig;

            var rangeHeroConfig = new HeroConfig()
            {
                HealthPoints       = 100,
                MovementSpeed      = 2,
                AutoAttackRange    = 10,
                AutoAttackDamage   = 2,
                AutoAttackInterval = 1,
                HeroType           = HeroType.Range,
            };

            configs[HeroType.Range] = rangeHeroConfig;

            var supportHeroConfig = new HeroConfig()
            {
                HealthPoints       = 100,
                MovementSpeed      = 2,
                AutoAttackRange    = 2,
                AutoAttackDamage   = 2,
                AutoAttackInterval = 1,
                HeroType           = HeroType.Support,
            };

            configs[HeroType.Support] = supportHeroConfig;

            return(configs);
        }