using Domain; namespace Presenter.SaveSystem { public class LoadGame { private readonly IGameRepository _repository; private readonly Score _score; private readonly IExpressionInput _expressionInput; private readonly IRoseSpawner _spawner; private readonly IRoseGrow _growAnimation; public LoadGame(IGameRepository repository, Score score, IExpressionInput expressionInput, IRoseSpawner spawner, IRoseGrow growAnimation) { _repository = repository; _score = score; _expressionInput = expressionInput; _spawner = spawner; _growAnimation = growAnimation; } public void Run() { Score newScore = _repository.LoadScore(); _score.SetFromOtherScore(newScore); _expressionInput.UpdateView(_score.Value, _score.GrowPercentage); _growAnimation.GrowStep(); int roses = _score.Value / (_score.SpawnRate * _score.GrowIterations); for (int i = 0; i < roses; i++) _spawner.SpawnRose(); } } }