-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRoad.hpp
48 lines (34 loc) · 1.05 KB
/
Road.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/***********************************************************
* Road.hpp *
* The road class *
* *
* Author: Artemy Belousov aka whimo *
***********************************************************/
#ifndef ROAD_HPP
#define ROAD_HPP
#include <iostream>
#include <vector>
#include <cstdint>
#include "Vehicle.hpp"
#include <SFML/Graphics.hpp>
class Road
{
private:
uint8_t lanes_num;
std::vector <Vehicle> vehicles;
public:
Road (uint8_t new_lanes_num);
void add_vehicle (uint8_t lane, double coord, double speed);
void add_vehicle (Vehicle vehicle);
void change_lanes (uint8_t new_lanes_num);
void add_lane (uint8_t num = 1);
void remove_lane (uint8_t num = 1);
int8_t get_lanes_num ();
void render (sf::RenderWindow* window,
size_t lane_width,
size_t CarWidth = 16,
size_t CarLength = 64,
int window_height = -1);
void move (int32_t time);
};
#endif //ROAD_HPP