Loading Assets/Scripts/Presenter/SaveSystem/LoadGame.cs +6 −2 Original line number Diff line number Diff line Loading @@ -5,11 +5,13 @@ namespace Presenter.SaveSystem { private readonly IGameRepository _repository; private readonly Score _score; private readonly IExpressionInput _expressionInput; private readonly IRoseSpawner _spawner; public LoadGame(IGameRepository repository, Score score, IExpressionInput expressionInput) { public LoadGame(IGameRepository repository, Score score, IExpressionInput expressionInput, IRoseSpawner spawner) { _repository = repository; _score = score; _expressionInput = expressionInput; _spawner = spawner; } public void Run() { Loading @@ -17,7 +19,9 @@ namespace Presenter.SaveSystem { _score.SetFromOtherScore(newScore); _expressionInput.UpdateView(_score.Value, _score.GrowPercentage); //spawn roses = _score.Value / (_score.SpawnRate * _score.GrowInteractions) int roses = _score.Value / (_score.SpawnRate * _score.GrowIterations); for (int i = 0; i < roses; i++) _spawner.SpawnRose(); } } } No newline at end of file Assets/Scripts/View/Dependencies.cs +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ namespace View { PlayerPrefsRepository repository = new(); Saver = new SaveGame(repository, Score); Loader = new LoadGame(repository, Score, inputCollections); Loader = new LoadGame(repository, Score, inputCollections, spawner); } } } No newline at end of file Loading
Assets/Scripts/Presenter/SaveSystem/LoadGame.cs +6 −2 Original line number Diff line number Diff line Loading @@ -5,11 +5,13 @@ namespace Presenter.SaveSystem { private readonly IGameRepository _repository; private readonly Score _score; private readonly IExpressionInput _expressionInput; private readonly IRoseSpawner _spawner; public LoadGame(IGameRepository repository, Score score, IExpressionInput expressionInput) { public LoadGame(IGameRepository repository, Score score, IExpressionInput expressionInput, IRoseSpawner spawner) { _repository = repository; _score = score; _expressionInput = expressionInput; _spawner = spawner; } public void Run() { Loading @@ -17,7 +19,9 @@ namespace Presenter.SaveSystem { _score.SetFromOtherScore(newScore); _expressionInput.UpdateView(_score.Value, _score.GrowPercentage); //spawn roses = _score.Value / (_score.SpawnRate * _score.GrowInteractions) int roses = _score.Value / (_score.SpawnRate * _score.GrowIterations); for (int i = 0; i < roses; i++) _spawner.SpawnRose(); } } } No newline at end of file
Assets/Scripts/View/Dependencies.cs +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ namespace View { PlayerPrefsRepository repository = new(); Saver = new SaveGame(repository, Score); Loader = new LoadGame(repository, Score, inputCollections); Loader = new LoadGame(repository, Score, inputCollections, spawner); } } } No newline at end of file