auto_bus/include/railsModel.h

75 lines
1.3 KiB
C
Raw Normal View History

2022-06-10 21:21:35 +08:00
//
// Created by ricardo on 2022/6/10.
//
2022-06-11 19:04:47 +08:00
#ifndef AUTO_BUS_GUI_RAILS_MODEL_H
#define AUTO_BUS_GUI_RAILS_MODEL_H
2022-06-10 21:21:35 +08:00
#include "cstdlib"
struct rail_node{
/**
*
*/
int id;
/**
*
*/
int last_node_distance;
/**
*
*/
int next_node_distance;
/**
*
*/
struct rail_node* last_node;
/**
*
*/
struct rail_node* next_node;
};
typedef struct rail_node rail_node_t;
class RailsModel
{
public:
/**
*
*/
rail_node_t *rails;
/**
2022-06-26 13:06:22 +08:00
*
*/
2022-06-26 13:06:22 +08:00
int node_num;
explicit RailsModel();
~RailsModel();
/**
*
* @param head
* @param id
* @return
*/
2022-06-10 21:21:35 +08:00
rail_node_t *FindNode(int node_num) const;
2022-06-26 13:06:22 +08:00
/**
*
* @param distance
* @param node_number
*/
void CreateRails(int distance, int node_number);
2022-06-10 21:21:35 +08:00
2022-06-26 13:06:22 +08:00
/**
*
*/
void FreeRails();
2022-06-10 21:21:35 +08:00
};
2022-06-11 19:04:47 +08:00
#endif //AUTO_BUS_GUI_RAILS_MODEL_H