SEGS  0.4.2
Super Entity Game Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MapManager.h
Go to the documentation of this file.
1 /*
2  * SEGS - Super Entity Game Server
3  * http://www.segs.io/
4  * Copyright (c) 2006 - 2018 SEGS Team (see Authors.txt)
5  * This software is licensed! (See License.txt for details)
6  */
7 
8 #pragma once
9 #include <map>
10 #include <vector>
11 #include <stdint.h>
12 #include <QHash>
13 
14 class MapTemplate;
15 class QString;
21 {
22  std::map<uint32_t,MapTemplate *> m_templates;
23  QHash<QString,MapTemplate *> m_name_to_template;
24  size_t m_max_instances; // how many maps can we instantiate
25 public:
26  MapManager();
27  ~MapManager();
28  bool load_templates(const QString &template_directory, uint8_t game_id, uint32_t map_id,
29  const struct ListenAndLocationAddresses &loc);
30  MapTemplate * get_template(QString id);
31  size_t num_templates();
32  size_t max_instances();
33  void shut_down_all();
34 };
MapTemplate * get_template(QString id)
Retrieves template specified by it&#39;s client-side path.
Definition: MapManager.cpp:66
Definition: MapTemplate.h:17
bool load_templates(const QString &template_directory, uint8_t game_id, uint32_t map_id, const struct ListenAndLocationAddresses &loc)
Loads all templates available in given directory, will populate m_templates attribute.
Definition: MapManager.cpp:45
size_t num_templates()
Definition: MapManager.cpp:73
~MapManager()
Definition: MapManager.cpp:36
size_t max_instances()
Definition: MapManager.cpp:78
Definition: ServerEndpoint.h:79
Definition: MapManager.h:20
MapManager()
Definition: MapManager.cpp:32
void shut_down_all()
Definition: MapManager.cpp:83