summaryrefslogtreecommitdiffhomepage
path: root/digital/beacon/src/position.c
diff options
context:
space:
mode:
authorFlorent Duchon2012-05-16 17:36:32 +0200
committerFlorent Duchon2012-05-16 17:43:11 +0200
commitb4b3abb33cf07fb0ef00c81fc5592e5e7667e717 (patch)
tree5aa4ca0be6839d119bbb3b83b7450c60ecd88bd9 /digital/beacon/src/position.c
parent3e4bd8280a6a19a8dabdf7ee5f17ae7e94baf40c (diff)
digital/beacon: add get coord and get trust API
Diffstat (limited to 'digital/beacon/src/position.c')
-rw-r--r--digital/beacon/src/position.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/digital/beacon/src/position.c b/digital/beacon/src/position.c
index 75fbad48..f3320321 100644
--- a/digital/beacon/src/position.c
+++ b/digital/beacon/src/position.c
@@ -153,4 +153,26 @@ int update_position(uint16_t beaconID, uint16_t angleID, float angle)
last_ID[0] = beaconID;
}
return 0;
+}
+
+/* This function returns the requested coord according to the opponent number */
+int16_t position_get_coord(TOpponent_ID id, TCoord_type type)
+{
+ switch(type)
+ {
+ case X:
+ return opponent[id].x;
+ break;
+ case Y:
+ return opponent[id].y;
+ break;
+ default:
+ return 0;
+ }
+}
+
+/* This function returns the trust according to opponent number */
+int8_t position_get_trust(TOpponent_ID id)
+{
+ return opponent[id].trust;
} \ No newline at end of file