public CHeroBase GetHero(EHeroTypes type) { CHeroFactory heroFactory = null; switch (type) { case EHeroTypes.Paladin: heroFactory = new CPaladinFactory(); break; case EHeroTypes.Mage: heroFactory = new CMageFactory(); break; case EHeroTypes.Thief: heroFactory = new CThiefFactory(); break; case EHeroTypes.Warrior: heroFactory = new CWarriorFactory(); break; default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } return(heroFactory.CreateHero()); }
private CHeroData(String name, EHeroTypes type, Int32 healthPoints, Int32 movingEnergy, String description) { Name = name; Type = type; HealthPoints = healthPoints; MovingEnergy = movingEnergy; Description = description; }
public static CHeroData Create(String name, EHeroTypes type, Int32 healthPoints, Int32 movingEnergy, String description) { return(new CHeroData(name, type, healthPoints, movingEnergy, description)); }
public CHeroData GetHero(EHeroTypes type) { CHeroDto heroDto = _heroesRepository.GetByType((Int32)type); return(MapHeroDataFromDto(heroDto)); }
public CHeroData GetHeroByType(EHeroTypes type) { CHeroesProvider provider = CHeroesProvider.Create(); return(provider.GetHero(type)); }