NerfUS game coordinator for the Nerf gun firing range
Dependencies: HardwareInterface mbed-rtos mbed
Fork of NerfUS by
include/Target.hpp@17:48474266a361, 2017-03-17 (annotated)
- Committer:
- Ismael Balafrej
- Date:
- Fri Mar 17 17:19:42 2017 -0400
- Branch:
- PlayableGame
- Revision:
- 17:48474266a361
- Parent:
- 16:5e6c695468b6
- Child:
- 18:469c8b2a9af9
First Commit of PlayableGame
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Maxime Dupuis |
16:5e6c695468b6 | 1 | #ifndef TARGET_HPP |
Maxime Dupuis |
16:5e6c695468b6 | 2 | #define TARGET_HPP |
Maxime Dupuis |
16:5e6c695468b6 | 3 | |
Maxime Dupuis |
16:5e6c695468b6 | 4 | enum TargetType |
Maxime Dupuis |
16:5e6c695468b6 | 5 | { |
Maxime Dupuis |
16:5e6c695468b6 | 6 | TARGET_TYPE_ALLY, |
Maxime Dupuis |
16:5e6c695468b6 | 7 | TARGET_TYPE_ENEMY |
Maxime Dupuis |
16:5e6c695468b6 | 8 | }; |
Maxime Dupuis |
16:5e6c695468b6 | 9 | |
Maxime Dupuis |
16:5e6c695468b6 | 10 | struct TargetInfo |
Maxime Dupuis |
16:5e6c695468b6 | 11 | { |
Maxime Dupuis |
16:5e6c695468b6 | 12 | int id; |
Maxime Dupuis |
16:5e6c695468b6 | 13 | TargetType type; |
Maxime Dupuis |
16:5e6c695468b6 | 14 | int timeout_ms; |
Maxime Dupuis |
16:5e6c695468b6 | 15 | |
Ismael Balafrej |
17:48474266a361 | 16 | void riseTarget(); |
Ismael Balafrej |
17:48474266a361 | 17 | |
Maxime Dupuis |
16:5e6c695468b6 | 18 | bool operator==(const TargetInfo& other) const |
Maxime Dupuis |
16:5e6c695468b6 | 19 | { |
Maxime Dupuis |
16:5e6c695468b6 | 20 | return (id == other.id) |
Maxime Dupuis |
16:5e6c695468b6 | 21 | && (type == other.type) |
Maxime Dupuis |
16:5e6c695468b6 | 22 | && (timeout_ms == other.timeout_ms); |
Maxime Dupuis |
16:5e6c695468b6 | 23 | } |
Maxime Dupuis |
16:5e6c695468b6 | 24 | }; |
Maxime Dupuis |
16:5e6c695468b6 | 25 | |
Maxime Dupuis |
16:5e6c695468b6 | 26 | TargetInfo make_TargetInfo(int id, TargetType type, int timeout_ms); |
Maxime Dupuis |
16:5e6c695468b6 | 27 | |
Maxime Dupuis |
16:5e6c695468b6 | 28 | #endif |
Maxime Dupuis |
16:5e6c695468b6 | 29 |