123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- /**
- * space_server 任务地图管理。
- *
- * © 2020 成都河狸智能科技有限责任公司。保留所有权利。
- *
- * 作者: zhq1229
- */
- #ifndef __MAP_H__
- #define __MAP_H__
- #include <map>
- #include <list>
- #include <string>
- using MapId = unsigned int;
- namespace task {
- namespace map {
- struct MapInfo {
- MapInfo():
- map_id(0),
- name(""),
- width(0),
- height(0),
- floor(0),
- resolution(0.0f),
- map("") {}
- MapId map_id;
- std::string name;
- unsigned int width;
- unsigned int height;
- int floor;
- float resolution;
- float x_origin;
- float y_origin;
- std::string map; // base64打包的地图数据
- };
- /**
- * 读取地图列表
- *
- * @return 地图列表
- */
- std::list<MapId> mapList();
- /**
- * 读取所有地图信息
- *
- * @return 所有地图信息
- */
- std::map<MapId, MapInfo> mapInfos();
- /**
- * 读取地图信息
- *
- * @param map_id [in] 地图id
- * @param map_info [out] 地图信息
- * @return 通用错误码
- */
- int mapInfo(MapId map_id, MapInfo &map_info);
- /**
- * 读取地图名称
- *
- * @param map_id [in] 地图id
- * @return 地图名称
- */
- std::string mapName(MapId map_id);
- /**
- * 保存地图
- *
- * @param map_info [in] 地图信息
- * @return 通用错误码
- */
- int mapSave(MapInfo &map_info);
- /**
- * 删除地图
- *
- * @param map_info [in] 地图id
- * @return 通用错误码
- */
- int mapDelete(MapId map_id);
- /**
- * 请求map_id,在建图时调用,获取一个唯一的地图编号
- *
- * @return 0-失败 1~99-地图编号
- */
- MapId mapReqId();
- } // namespace map
- } // namespace task
- #endif // __MAP_H__
|