Coordinator v2
Dependencies: NerfUSXbee PinDetect EthernetInterface JSON MFRC522 WebSocketClient mbed-rtos mbed
Diff: includes/dispatcher.hpp
- Revision:
- 1:e1c5259b7d9a
- Child:
- 2:019d8848cf7e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/includes/dispatcher.hpp Mon Apr 10 15:02:24 2017 -0400 @@ -0,0 +1,23 @@ +#pragma once +#include "ports.hpp" +#include "ServerData.hpp" +#include "GameCoordinator.hpp" +#include <vector> + +void dispatch_event_from_target(vector<uint8_t> data, int* address) +{ + //addr: table of 8 int + //TODO - calc stats +} + +void dispatch_event_from_server(ServerEvent *event) { + toPc("Event Name: %s", event->event); + if (strcmp(event->event, "start_game") == 0) + { + gameCoordinator.start_game(&(event->data)); + } + else if (strcmp(event->event, "request_report") == 0) + { + gameCoordinator.stop_game(); + } +} \ No newline at end of file