Esempio n. 1
0
 public Hero(string name, double dps, double health)
 {
     this.Name     = name;
     this.DPS      = dps;
     this.Health   = health;
     this.Resource = new AbilityResource(ResourceType.Unassigned, 0, 0);
 }
        public static AbilityResourceVM Create(AbilityResource model)
        {
            Func <AbilityResourceVM> factoryMethod;

            if (!_factoryMethods.TryGetValue(model.GetType(), out factoryMethod))
            {
                throw new NotSupportedException(String.Format("{0} is not supported.", model.GetType().Name));
            }

            AbilityResourceVM viewModel = factoryMethod();

            viewModel.Model = model;
            return(viewModel);
        }
Esempio n. 3
0
        public static Ability Create(AbilityResource resource)
        {
            Func <Ability> factoryMethod;

            if (!_specialFactories.TryGetValue(resource.ID, out factoryMethod))
            {
                factoryMethod = () => new Ability();
            }

            Ability newAbility = factoryMethod();

            newAbility.AbilityResourceIndex = (int)resource.ID;
            newAbility.Level = 1;
            return(newAbility);
        }
Esempio n. 4
0
 public EnergyHero(string name, double dps, double health, AbilityResource resource) : base(name, dps, health)
 {
     this.Resource = resource;
 }