auto_bus/include/railsModel.h

63 lines
1.1 KiB
C
Raw Normal View History

2022-06-10 21:21:35 +08:00
//
// Created by ricardo on 2022/6/10.
//
#ifndef AUTO_BUS_GUI_RAILSMODEL_H
#define AUTO_BUS_GUI_RAILSMODEL_H
#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;
/**
*
* @param distance
* @param node_number
*/
2022-06-10 21:21:35 +08:00
explicit RailsModel(int distance = 2, int node_number = 5);
/**
*
* @param head
* @param id
* @return
*/
2022-06-10 21:21:35 +08:00
rail_node_t *FindNode(int node_num) const;
~RailsModel();
};
#endif //AUTO_BUS_GUI_RAILSMODEL_H