-
Notifications
You must be signed in to change notification settings - Fork 0
/
Line.h
52 lines (41 loc) · 1.1 KB
/
Line.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once
#include "Station.h"
#include <QDebug>
#include <QFile>
#include <QIcon>
#include <QList>
#include <QStringList>
#include <QStringListModel>
#include <QTextStream>
class Line
{
private:
QStringList list_Stations;
public:
/// @brief 线路编号
uint number;
/// @brief 线路长度(线路包含地铁站数量)
uint length;
QList<Station*> stations;
QStringListModel* model_Stations;
QIcon icon;
QString mapFileName;
Line(int number);
void AddStation(Station *station);
};
extern QList<Line*> lineList;
/// @brief 从文件读取站点信息
/// @param fileName 文件名
void ReadStationInfo(const QString fileName);
/// @brief 根据线路编号查找线路
/// @param stationId
/// @return 指向该线路的指针
Line* FindLineByNumber(int number);
/// @brief 根据站点名称查找站点
/// @param stationName 站点名称
/// @return 包含所有该站点的列表
QList<Station*> FindStationsByName(QString stationName);
/// @brief 根据站点ID查找站点
/// @param stationId 站点ID
/// @return 指向该站点的指针
Station* FindStationById(QString stationId);