chore: cleanup

This commit is contained in:
redglow
2026-07-29 11:05:27 +02:00
parent 2c0a3f47a4
commit 5c4519ed26
20 changed files with 110 additions and 70 deletions
+12 -4
View File
@@ -9,16 +9,24 @@ namespace GodotHostTest.Game.Score;
public partial class Score : Control
{
[Export] private AnimationPlayer _animationPlayer = null!;
[Inject] private ICurrentLevel _currentLevel = null!;
[Export] private Label _label = null!;
[Inject] private IScore _score = null!;
public override void _Ready()
{
_score.Score.Subscribe(UpdateScore).AddTo(this);
_score.Score.Chunk(2, 1).Where(values => values.Length == 2 && values[1] < values[0])
.Subscribe(OnScoreDecreasing).AddTo(this);
// update the score label whenever the score changes
_score.Score
.Subscribe(UpdateScore)
.AddTo(this);
// run an animation whenever the score decreases
_score.Score
.Chunk(2, 1)
.Where(values => values.Length == 2 && values[1] < values[0])
.Subscribe(OnScoreDecreasing)
.AddTo(this);
}
private void OnScoreDecreasing<T>(T _)