using Domain;

namespace Presenter {
	public class ExpressionClick {
		private readonly Model _model;
		private readonly IExpressionInput _view;
		private readonly IRoseSpawner _spawner;

		public ExpressionClick(Model model, IExpressionInput view, IRoseSpawner spawner) {
			_model = model;
			_view = view;
			_spawner = spawner;
		}

		public void Execute() {
			_model.AddScore();
			_view.UpdateView(_model.Score);

			if (_model.NeedsToSpawn()) {
				_spawner.SpawnRose();
			}
		}
	}
}