// intersection.h for traffic simulation #ifndef INTERSECTION_H_ #define INTERSECTION_H_ #include "simulation.h" #include "vehicle.h" #include "lane.h" class intersection { public: intersection(float Ax_location, float Ay_location, intersection * Aintersection_list); void set_signal( intersection * Aintersection_list, signal_state Anorth_south, signal_state Aeast_west); void operate(intersection * Aintersection_list); void creator( float Alength, float Aweight, float Aaccel, float Adecell, direction Amoving); void connect_from( intersection * Aintersection_list); intersection * next(void); void draw(intersection * Aintersection_list); private: float x_location; float y_location; intersection * next_intersection; lane * lane_north; // fed by lane * lane_from_south; lane * lane_east; // fed by lane * lane_from_west; lane * lane_south; // fed by lane * lane_from_north; lane * lane_west; // fed by lane * lane_from_east; signal_state north_south; signal_state east_west; }; // end intersection.h #endif // INTERSECTION_H_