SEGS  0.6.1-develop [d2cac982]
Super Entity Game Server
map_definitions.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 
10 #include <glm/vec2.hpp>
11 #include <glm/vec3.hpp>
12 #include <QtCore/QString>
13 #include <QtCore/QStringList>
14 #include <vector>
15 
16 enum MapXferType : uint32_t
17 {
18  DOOR = 0,
19  ZONE = 1,
21 };
22 
23 struct EntityData;
24 
25 struct Map_Data
26 {
27  glm::vec2 Location;
28  glm::vec2 TextLocation;
29  QByteArray Name;
30  QByteArray Icon;
31 };
32 
33 struct MapData
34 {
35  uint32_t m_map_idx;
36  QByteArray m_map_name; // City_00_01, City_01_01, etc...
37  QByteArray m_map_path; // The ones ending with .txt
38  QByteArray m_display_map_name; // Outbreak, Atlas Park...
39 };
40 
42 {
43  QString m_node_name;
44  QString m_target_map_name; // City_01_01
45  QString m_target_spawn_name; // Name of related spawnLocation node.
46  glm::vec3 m_position;
48  template<class Archive>
49  void serialize(Archive &ar)
50  {
51  ar(m_node_name, m_target_map_name, m_target_spawn_name, m_position, m_transfer_type);
52  }
53 };
54 
55 using AllMaps_Data = std::vector<Map_Data>;
56 
57 uint32_t getMapIndex(const QString &map_name);
58 const std::vector<MapData> &getAllMapData();
59 const MapData &getMapData(const QString &map_name);
60 QString getMapName(const QString &map_name);
61 QString getMapName(uint32_t map_idx);
62 QString getDisplayMapName(uint32_t index);
63 QString getEntityDisplayMapName(const EntityData &ed);
65 QString getMapPath(uint32_t index);
66 QString getMapPath(const EntityData &ed);
67 QString getMapPath(const QString &map_name);
glm::vec2 TextLocation
Definition: map_definitions.h:28
QByteArray m_map_path
Definition: map_definitions.h:37
Definition: map_definitions.h:20
QByteArray Icon
Definition: map_definitions.h:30
QString getMapPath(uint32_t index)
Definition: map_definitions.cpp:131
QString getEntityDisplayMapName(const EntityData &ed)
Definition: map_definitions.cpp:106
QString getDisplayMapName(uint32_t index)
Definition: map_definitions.cpp:93
void serialize(Archive &ar)
Definition: map_definitions.h:49
const MapData & getMapData(const QString &map_name)
Definition: map_definitions.cpp:46
Definition: map_definitions.h:19
Definition: entitydata_definitions.h:14
QString m_target_spawn_name
Definition: map_definitions.h:45
MapXferType
Definition: map_definitions.h:16
std::vector< Map_Data > AllMaps_Data
Definition: map_definitions.h:55
const std::vector< MapData > & getAllMapData()
Definition: map_definitions.cpp:41
glm::vec3 m_position
Definition: map_definitions.h:46
QByteArray Name
Definition: map_definitions.h:29
Definition: map_definitions.h:33
QByteArray m_map_name
Definition: map_definitions.h:36
QString m_node_name
Definition: map_definitions.h:43
Definition: map_definitions.h:25
QByteArray m_display_map_name
Definition: map_definitions.h:38
QString getMapName(const QString &map_name)
bool isEntityOnMissionMap(const EntityData &ed)
Definition: map_definitions.cpp:111
Definition: map_definitions.h:18
EntityData & ed
Definition: entitydata_serializers.cpp:24
uint32_t m_map_idx
Definition: map_definitions.h:35
glm::vec2 Location
Definition: map_definitions.h:27
MapXferType m_transfer_type
Definition: map_definitions.h:47
QString m_target_map_name
Definition: map_definitions.h:44
Definition: map_definitions.h:41
uint32_t getMapIndex(const QString &map_name)
Definition: map_definitions.cpp:60