feat: loading spawned roses
This commit is contained in:
parent
2562567f47
commit
339b62faf7
2 changed files with 7 additions and 3 deletions
|
@ -5,11 +5,13 @@ namespace Presenter.SaveSystem {
|
||||||
private readonly IGameRepository _repository;
|
private readonly IGameRepository _repository;
|
||||||
private readonly Score _score;
|
private readonly Score _score;
|
||||||
private readonly IExpressionInput _expressionInput;
|
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;
|
_repository = repository;
|
||||||
_score = score;
|
_score = score;
|
||||||
_expressionInput = expressionInput;
|
_expressionInput = expressionInput;
|
||||||
|
_spawner = spawner;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Run() {
|
public void Run() {
|
||||||
|
@ -17,7 +19,9 @@ namespace Presenter.SaveSystem {
|
||||||
_score.SetFromOtherScore(newScore);
|
_score.SetFromOtherScore(newScore);
|
||||||
_expressionInput.UpdateView(_score.Value, _score.GrowPercentage);
|
_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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -29,7 +29,7 @@ namespace View {
|
||||||
|
|
||||||
PlayerPrefsRepository repository = new();
|
PlayerPrefsRepository repository = new();
|
||||||
Saver = new SaveGame(repository, Score);
|
Saver = new SaveGame(repository, Score);
|
||||||
Loader = new LoadGame(repository, Score, inputCollections);
|
Loader = new LoadGame(repository, Score, inputCollections, spawner);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Add a link
Reference in a new issue