refactor: Cleaned up score view interface
This commit is contained in:
parent
779af276d3
commit
858e49e1d9
13 changed files with 36 additions and 123 deletions
|
@ -3,14 +3,14 @@
|
|||
namespace Presenter {
|
||||
public class ExpressionClick {
|
||||
private readonly Score _score;
|
||||
private readonly IExpressionInput _view;
|
||||
private readonly IScoreView _view;
|
||||
private readonly IRoseGrow _grow;
|
||||
private readonly IInputCallback _onInputReceived;
|
||||
private readonly IRoseSpawner _spawner;
|
||||
|
||||
private bool CanSpawn => _score.Value % (_score.GrowIterations * _score.SpawnRate) == 0;
|
||||
|
||||
public ExpressionClick(Score score, IExpressionInput view, IRoseSpawner spawner, IRoseGrow grow, IInputCallback inputCallback) {
|
||||
public ExpressionClick(Score score, IScoreView view, IRoseSpawner spawner, IRoseGrow grow, IInputCallback inputCallback) {
|
||||
_score = score;
|
||||
_view = view;
|
||||
_spawner = spawner;
|
||||
|
@ -20,7 +20,7 @@ namespace Presenter {
|
|||
|
||||
public void Execute() {
|
||||
_score.Add();
|
||||
_view.UpdateView(_score.Value, _score.GrowPercentage);
|
||||
_view.UpdateView(_score.Value);
|
||||
_onInputReceived.OnInputReceived();
|
||||
|
||||
if (CanSpawn)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue