<reponame>Shad0wPie/TrafficMadness
from traffic_madness.config import Config


class Car:
    def __init__(self, position, velocity, lane=0, nice=False):
        self.position = position
        self.lane = lane
        self.velocity = velocity
        self.nice = nice
        self.stuck = False
        config = Config()
        self.velocity_factor = config.velocity_factor
#        self.delay_buffer_length = config.delay_buffer_length
        self.min_distance = config.min_distance
        self.reaction_time = config.reaction_time
        self.timestep = config.timestep
        self.safetymultiplier = config.safetymultiplier
        self.acceleration = config.acceleration
        self.deceleration = config.deceleration
        self.length = config.car_length
        self.color = (0, 0, 255)
        # self.color = (64 + random.randint(0, 127),
        #               64 + random.randint(0, 127),
        #               64 + random.randint(0, 127))
        self.delay_buffer = []
        self.last_reaction_time = - self.reaction_time #- to allow instant change 

    def update(self, target_speed, nearby_cars):
        pass

from traffic_madness.config import Config


class Car:
    def __init__(self, position, velocity, lane=0, nice=False):
        self.position = position
        self.lane = lane
        self.velocity = velocity
        self.nice = nice
        self.stuck = False
        config = Config()
        self.velocity_factor = config.velocity_factor
#        self.delay_buffer_length = config.delay_buffer_length
        self.min_distance = config.min_distance
        self.reaction_time = config.reaction_time
        self.timestep = config.timestep
        self.safetymultiplier = config.safetymultiplier
        self.acceleration = config.acceleration
        self.deceleration = config.deceleration
        self.length = config.car_length
        self.color = (0, 0, 255)
        # self.color = (64 + random.randint(0, 127),
        #               64 + random.randint(0, 127),
        #               64 + random.randint(0, 127))
        self.delay_buffer = []
        self.last_reaction_time = - self.reaction_time #- to allow instant change 

    def update(self, target_speed, nearby_cars):
        pass
#        self.delay_buffer_length = config.delay_buffer_length # self.color = (64 + random.randint(0, 127), #               64 + random.randint(0, 127), #               64 + random.randint(0, 127)) #- to allow instant change