2020-09-13 23:37:55 +01:00
|
|
|
#pragma once
|
2018-09-24 17:02:50 +01:00
|
|
|
#ifndef MAPCONNECTION_H
|
|
|
|
#define MAPCONNECTION_H
|
|
|
|
|
|
|
|
#include <QString>
|
2019-01-15 22:06:18 +00:00
|
|
|
#include <QHash>
|
2018-09-24 17:02:50 +01:00
|
|
|
|
2024-07-08 21:01:30 +01:00
|
|
|
class Map;
|
|
|
|
|
2018-09-24 17:02:50 +01:00
|
|
|
class MapConnection {
|
|
|
|
public:
|
|
|
|
QString direction;
|
2022-10-16 07:49:42 +01:00
|
|
|
int offset;
|
2018-09-24 17:02:50 +01:00
|
|
|
QString map_name;
|
2024-07-12 19:05:37 +01:00
|
|
|
|
|
|
|
static const QStringList cardinalDirections;
|
|
|
|
static bool isCardinal(const QString &direction);
|
|
|
|
static bool isHorizontal(const QString &direction);
|
|
|
|
static bool isVertical(const QString &direction);
|
|
|
|
static MapConnection mirror(const MapConnection &source, const QString &mapName);
|
2018-09-24 17:02:50 +01:00
|
|
|
};
|
|
|
|
|
2024-07-08 21:01:30 +01:00
|
|
|
struct MapConnectionMirror {
|
|
|
|
MapConnection * connection = nullptr;
|
|
|
|
Map * map = nullptr;
|
|
|
|
};
|
2019-01-15 22:06:18 +00:00
|
|
|
|
2024-07-08 21:01:30 +01:00
|
|
|
inline bool operator==(const MapConnection &c1, const MapConnection &c2) {
|
|
|
|
return c1.direction == c2.direction &&
|
|
|
|
c1.offset == c2.offset &&
|
|
|
|
c1.map_name == c2.map_name;
|
2019-01-15 22:06:18 +00:00
|
|
|
}
|
|
|
|
|
2018-09-24 17:02:50 +01:00
|
|
|
#endif // MAPCONNECTION_H
|