FemMaps/map/SigalertRoadSensor.h

37 lines
877 B
C
Raw Permalink Normal View History

2023-10-15 01:49:35 -07:00
//
// Created by scoliono on 10/14/23.
//
#ifndef FEMMAPS_SIGALERTROADSENSOR_H
#define FEMMAPS_SIGALERTROADSENSOR_H
2023-10-30 00:53:00 -07:00
#include "Road.h"
#include "RoadSensor.h"
#include "SigalertRoad.h"
2023-10-15 01:49:35 -07:00
#include <string>
2023-10-30 00:53:00 -07:00
class SigalertRoadSensor : public RoadSensor {
2023-10-15 01:49:35 -07:00
public:
2023-10-30 00:53:00 -07:00
SigalertRoadSensor(const int id, const std::string& name, const std::vector<int>& pos, int speed);
virtual ~SigalertRoadSensor();
inline const Road* road() { return static_cast<const Road*>(m_road); }
inline void setRoad(const SigalertRoad* road) { m_road = road; }
inline const char* name() { return m_name.c_str(); }
inline const int* pos() { return m_pos; }
inline int speed() { return m_speed; }
int speedLimit();
2023-10-15 01:49:35 -07:00
private:
2023-10-30 00:53:00 -07:00
int m_id;
const SigalertRoad* m_road;
2023-10-15 01:49:35 -07:00
std::string m_name;
2023-10-30 00:53:00 -07:00
const int m_pos[2];
2023-10-15 01:49:35 -07:00
int m_speed;
};
#endif //FEMMAPS_SIGALERTROADSENSOR_H