iFun Engine API  1.0.0-b6053
Great Technology for Great Games
map_loader.h
Go to the documentation of this file.
1 // Copyright (C) 2013-2020 iFunFactory Inc. All Rights Reserved.
2 //
3 // This work is confidential and proprietary to iFunFactory Inc. and
4 // must not be used, disclosed, copied, or distributed without the prior
5 // consent of iFunFactory Inc.
6 //
7 
10 #ifndef INCLUDE_FUNAPI_SERVICE_MAP_LOADER_H_
11 #define INCLUDE_FUNAPI_SERVICE_MAP_LOADER_H_
12 
13 #include <boost/noncopyable.hpp>
15 #include <funapi/types.h>
16 
17 #include <map>
18 
19 namespace fun {
20 
21 class FUNAPI_DLL_VISIBILITY MapLoader {
22  public:
23  typedef http::Uri MapUri;
24  typedef string MapData;
25  typedef std::vector<string> MapTagList;
26 
27  struct FUNAPI_DLL_VISIBILITY Map : private boost::noncopyable {
29 
30  MapUri uri;
31  string name;
32  string md5;
33  MapData data;
34  MapTagList tag_list;
35  };
36 
37  typedef std::vector<Ptr<Map> > MapList;
38 
39  typedef function<
40  void (const Ptr<MapList> &mutable_map_list)> OnMapListDownloaded;
41 
42  typedef function<
43  void (const bool &error,
44  const bool &is_map_changed,
45  const Ptr<const MapList> &map_list)> OnMapLoadCompleted;
46 
47  static void LoadAsync(const OnMapListDownloaded &on_map_list_downloaded,
48  const OnMapLoadCompleted &on_map_load_completed);
49  static const Ptr<const Map> FindMapByMd5(const string &map_md5);
50  static const Ptr<const MapList> FindMapByTag(const string &map_tag);
51  static const Ptr<const MapList> GetMapList();
52 };
53 
54 } // namespace fun
55 
56 #endif // INCLUDE_FUNAPI_SERVICE_MAP_LOADER_H_
Definition: map_loader.h:27
Definition: map_loader.h:21
Definition: json.h:18
Class to parse an URI string.
Definition: http_util.h:161
#define DECLARE_CLASS_PTR(CLS)
Utility macro to forward-declare smart pointer types for a given class.
Definition: types.h:89