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); }
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); }
public EnergyHero(string name, double dps, double health, AbilityResource resource) : base(name, dps, health) { this.Resource = resource; }