SEGS  0.6.1-develop [d2cac982]
Super Entity Game Server
MapTemplate.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
10 
11 #include <QString>
12 #include <vector>
13 
14 class MapInstance;
15 
16 // TODO: instances should be uniquely identifiable, so getting a Client/Team specific instances is possible
18 {
19 static uint8_t s_template_id;
20  std::vector<MapInstance *> m_instances; // switch from vector to priority queue ?
21  QString m_map_filename;
22  uint8_t m_game_server_id;
23  uint32_t m_map_server_id;
24  ListenAndLocationAddresses m_base_loc;
25 
26 public:
27  MapTemplate(const QString &template_filename,
28  uint8_t game_server_id, uint32_t map_server_id,
29  const ListenAndLocationAddresses &loc);
31  size_t num_instances();
32  void shut_down_all();
33  QString client_filename() const;
34  QString base_name() const;
35 };
36 
37 // Generates instances based on some kind of schema file
39 {
40 public:
42 };
Definition: MapTemplate.h:17
MapTemplate(const QString &template_filename, uint8_t game_server_id, uint32_t map_server_id, const ListenAndLocationAddresses &loc)
Definition: MapTemplate.cpp:20
QString base_name() const
Definition: MapTemplate.cpp:59
Definition: MapInstance.h:132
Definition: MapTemplate.h:38
size_t num_instances()
If there are no instances, starts a new one.
Definition: MapTemplate.cpp:68
Definition: ServerEndpoint.h:74
MapInstance * get_instance()
Definition: MapTemplate.cpp:26
void shut_down_all()
Definition: MapTemplate.cpp:40
QString client_filename() const
Definition: MapTemplate.cpp:53