blob: 08abdb71480e154376e2d47e29fb68e3e2b65fd1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
using Celesteia.Game.Input.Definitions;
namespace Celesteia.Game.Input.Conditions {
public class AverageCondition : ICondition<float> {
private IFloatInputDefinition[] _definitions;
public AverageCondition(params IFloatInputDefinition[] definitions)
=> _definitions = definitions;
public float Poll() {
float total = 0f;
for (int i = 0; i < _definitions.Length; i++) total += _definitions[i].Test();
return total / _definitions.Length;
}
}
}
|