refactor: renamed some classes

This commit is contained in:
Gerard Gascón 2024-04-15 17:25:24 +02:00
parent 0e7a535f6d
commit 6b1b935ea9
7 changed files with 10 additions and 10 deletions

View file

@ -0,0 +1,49 @@
using Domain;
using Domain.Input;
using Presenter;
using TMPro;
using UnityEngine;
namespace View {
public class ExpressionInput : MonoBehaviour, IExpressionInput {
[SerializeField] private TMP_Text text;
private ExpressionClick _click;
private CustomInput _customInput;
private void Start() {
_click = FindObjectOfType<Dependencies>().ExpressionClick;
_customInput = FindObjectOfType<Dependencies>().CustomInput;
}
private void Update() {
CheckInput();
}
private void CheckInput() {
_customInput.UpdateInput();
if (_customInput.KeyDown(typeof(GeminadaReader)))
_click.Execute();
if (_customInput.KeyDown(typeof(CedillaReader)))
_click.Execute();
if (_customInput.KeyDown(typeof(IxReader)))
_click.Execute();
if (_customInput.KeyDown(typeof(LlReader)))
_click.Execute();
if (_customInput.KeyDown(typeof(NyReader)))
_click.Execute();
if (_customInput.KeyDown(typeof(SsReader)))
_click.Execute();
if (_customInput.KeyDown(typeof(TgReader)))
_click.Execute();
if (_customInput.KeyDown(typeof(TjReader)))
_click.Execute();
if (_customInput.KeyDown(typeof(TxReader)))
_click.Execute();
}
public void UpdateView(int score) {
text.text = score.ToString();
}
}
}