|
1 | 1 | using Nucleus; |
2 | 2 |
|
3 | | -namespace CloneDash.Game.Input |
| 3 | +namespace CloneDash.Game.Input; |
| 4 | + |
| 5 | + |
| 6 | +public struct PollParams { |
| 7 | + public int AmountOfTimesHit; |
| 8 | + public int HitsRemaining; |
| 9 | + public PathwaySide Pathway; |
| 10 | +} |
| 11 | + |
| 12 | +public struct PollResult |
4 | 13 | { |
5 | | - public struct PollResult |
6 | | - { |
7 | | - public bool Hit; |
8 | | - public DashModelEntity HitEntity; |
9 | | - public double DistanceToHit; |
10 | | - public string Greatness; |
11 | | - |
12 | | - public static readonly PollResult Empty = new PollResult() { Hit = false }; |
13 | | - |
14 | | - public static PollResult Create(DashModelEntity hitEntity, double distanceToHit, string greatness) { |
15 | | - PollResult result = new PollResult(); |
16 | | - result.Hit = true; |
17 | | - result.HitEntity = hitEntity; |
18 | | - result.DistanceToHit = distanceToHit; |
19 | | - result.Greatness = greatness; |
20 | | - |
21 | | - return result; |
22 | | - } |
| 14 | + /// <summary> |
| 15 | + /// Did this input hit something? |
| 16 | + /// </summary> |
| 17 | + public bool Hit; |
| 18 | + /// <summary> |
| 19 | + /// What did it hit? |
| 20 | + /// </summary> |
| 21 | + public DashModelEntity HitEntity; |
| 22 | + public double DistanceToHit; |
| 23 | + public string Greatness; |
| 24 | + |
| 25 | + /// <summary> |
| 26 | + /// If true, the input will not be counted, which in this context means that the input will be polled again |
| 27 | + /// </summary> |
| 28 | + public bool DoNotCount; |
| 29 | + |
| 30 | + public static readonly PollResult Empty = new PollResult() { Hit = false }; |
| 31 | + |
| 32 | + public static PollResult Create(DashModelEntity hitEntity, double distanceToHit, string greatness) { |
| 33 | + PollResult result = new PollResult(); |
| 34 | + result.Hit = true; |
| 35 | + result.HitEntity = hitEntity; |
| 36 | + result.DistanceToHit = distanceToHit; |
| 37 | + result.Greatness = greatness; |
| 38 | + |
| 39 | + return result; |
| 40 | + } |
23 | 41 |
|
24 | | - public bool IsPerfect { |
25 | | - get { |
26 | | - if (!Hit) return false; |
| 42 | + public bool IsPerfect { |
| 43 | + get { |
| 44 | + if (!Hit) return false; |
27 | 45 |
|
28 | | - double distance = DistanceToHit; |
29 | | - double pregreat = -HitEntity.PreGreatRange, postgreat = HitEntity.PostGreatRange; |
30 | | - double preperfect = -HitEntity.PrePerfectRange, postperfect = HitEntity.PostPerfectRange; |
| 46 | + double distance = DistanceToHit; |
| 47 | + double pregreat = -HitEntity.PreGreatRange, postgreat = HitEntity.PostGreatRange; |
| 48 | + double preperfect = -HitEntity.PrePerfectRange, postperfect = HitEntity.PostPerfectRange; |
31 | 49 |
|
32 | | - return NMath.InRange(distance, preperfect, postperfect); |
33 | | - } |
| 50 | + return NMath.InRange(distance, preperfect, postperfect); |
34 | 51 | } |
35 | | - public bool IsAtLeastGreat { |
36 | | - get { |
37 | | - if (!Hit) return false; |
| 52 | + } |
| 53 | + public bool IsAtLeastGreat { |
| 54 | + get { |
| 55 | + if (!Hit) return false; |
38 | 56 |
|
39 | | - double distance = DistanceToHit; |
40 | | - double pregreat = -HitEntity.PreGreatRange, postgreat = HitEntity.PostGreatRange; |
| 57 | + double distance = DistanceToHit; |
| 58 | + double pregreat = -HitEntity.PreGreatRange, postgreat = HitEntity.PostGreatRange; |
41 | 59 |
|
42 | | - return NMath.InRange(distance, pregreat, postgreat); |
43 | | - } |
| 60 | + return NMath.InRange(distance, pregreat, postgreat); |
44 | 61 | } |
45 | 62 | } |
46 | 63 | } |
0 commit comments