public Dragon(IDragonRepository repository) { try { Id = repository.GetAll().LastOrDefault().Id + 1; } catch (ArgumentNullException) { Id = 1; } finally { CreatedHealthPoints = CreationServices.GetRandomInt(80, 100); CurrentHealthPoints = CreatedHealthPoints; Name = CreationServices.GetRandomString(CreationServices.GetRandomInt()); DateOfCreation = DateTime.Now; } }
public HitService(IHitRepository repository, IDragonRepository dragonRepository, IHeroRepository heroRepository, IDataAdapter dataAdapter) : base(repository, dataAdapter) { _dragonRepository = dragonRepository; _heroRepository = heroRepository; }
public DragonService(IDragonRepository repository, IDataAdapter dataAdapter) : base(repository, dataAdapter) { _repository = repository; }