SEGS  0.6.1-develop [39915b3b]
Super Entity Game Server
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 - 2019 SEGS Team (see AUTHORS.md)
5  * This software is licensed under the terms of the 3-clause BSD License. See LICENSE.md 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:64
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:39
size_t num_templates()
Definition: MapManager.cpp:71
~MapManager()
Definition: MapManager.cpp:30
size_t max_instances()
Definition: MapManager.cpp:76
Definition: ServerEndpoint.h:74
Definition: MapManager.h:20
MapManager()
Definition: MapManager.cpp:26
void shut_down_all()
Definition: MapManager.cpp:81