JSON file in mbed.
Dependencies: MbedJSONValue SDFileSystem mbed
Fork of City_Game_JSON by
mission.h@2:e6a095fc2274, 2017-03-29 (annotated)
- Committer:
- AlexVC97
- Date:
- Wed Mar 29 07:01:05 2017 +0000
- Revision:
- 2:e6a095fc2274
- Child:
- 5:eedf89829452
City_Game_JSON
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AlexVC97 | 2:e6a095fc2274 | 1 | #pragma once |
AlexVC97 | 2:e6a095fc2274 | 2 | #include <iostream> |
AlexVC97 | 2:e6a095fc2274 | 3 | #include "MbedJSONValue.h" |
AlexVC97 | 2:e6a095fc2274 | 4 | |
AlexVC97 | 2:e6a095fc2274 | 5 | namespace VivesCityGame |
AlexVC97 | 2:e6a095fc2274 | 6 | { |
AlexVC97 | 2:e6a095fc2274 | 7 | class Mission |
AlexVC97 | 2:e6a095fc2274 | 8 | { |
AlexVC97 | 2:e6a095fc2274 | 9 | // declarations |
AlexVC97 | 2:e6a095fc2274 | 10 | private: |
AlexVC97 | 2:e6a095fc2274 | 11 | std::string type; |
AlexVC97 | 2:e6a095fc2274 | 12 | int id; |
AlexVC97 | 2:e6a095fc2274 | 13 | std::string message; |
AlexVC97 | 2:e6a095fc2274 | 14 | std::string hint; |
AlexVC97 | 2:e6a095fc2274 | 15 | bool deadline; |
AlexVC97 | 2:e6a095fc2274 | 16 | int deadlineTime; |
AlexVC97 | 2:e6a095fc2274 | 17 | double latitude; |
AlexVC97 | 2:e6a095fc2274 | 18 | double longitude; |
AlexVC97 | 2:e6a095fc2274 | 19 | int radius; |
AlexVC97 | 2:e6a095fc2274 | 20 | |
AlexVC97 | 2:e6a095fc2274 | 21 | // getters |
AlexVC97 | 2:e6a095fc2274 | 22 | public: |
AlexVC97 | 2:e6a095fc2274 | 23 | std::string get_type(); |
AlexVC97 | 2:e6a095fc2274 | 24 | int get_id(); |
AlexVC97 | 2:e6a095fc2274 | 25 | std::string get_message(); |
AlexVC97 | 2:e6a095fc2274 | 26 | std::string get_hint(); |
AlexVC97 | 2:e6a095fc2274 | 27 | bool get_deadline(); |
AlexVC97 | 2:e6a095fc2274 | 28 | int get_deadlineTime(); |
AlexVC97 | 2:e6a095fc2274 | 29 | double get_latitude(); |
AlexVC97 | 2:e6a095fc2274 | 30 | double get_longitude(); |
AlexVC97 | 2:e6a095fc2274 | 31 | int get_radius(); |
AlexVC97 | 2:e6a095fc2274 | 32 | |
AlexVC97 | 2:e6a095fc2274 | 33 | // method from_json |
AlexVC97 | 2:e6a095fc2274 | 34 | public: |
AlexVC97 | 2:e6a095fc2274 | 35 | void from_json(MbedJSONValue& json); |
AlexVC97 | 2:e6a095fc2274 | 36 | |
AlexVC97 | 2:e6a095fc2274 | 37 | // method to_string |
AlexVC97 | 2:e6a095fc2274 | 38 | public: |
AlexVC97 | 2:e6a095fc2274 | 39 | std::string to_string(); |
AlexVC97 | 2:e6a095fc2274 | 40 | }; |
AlexVC97 | 2:e6a095fc2274 | 41 | }; |