22 lines
622 B
C
22 lines
622 B
C
// include/route.h
|
|
#ifndef ROUTE_H
|
|
#define ROUTE_H
|
|
|
|
#include "station.h"
|
|
|
|
#define MAX_STATIONS_PER_ROUTE 50
|
|
|
|
typedef struct BusRoute {
|
|
int id;
|
|
char routeName[50];
|
|
int stationCount;
|
|
int stations[MAX_STATIONS_PER_ROUTE]; // 站点ID序列
|
|
double segmentTimes[MAX_STATIONS_PER_ROUTE]; // 每段行驶时间(分钟)
|
|
} BusRoute;
|
|
|
|
// 线路管理函数
|
|
int loadRoutes(const char* filename, BusRoute routes[], int maxRoutes);
|
|
void displayRoute(const BusRoute* route, const Station stations[], int stationCount);
|
|
void displayAllRoutes(const BusRoute routes[], int routeCount, const Station stations[], int stationCount);
|
|
|
|
#endif |