Package car_sim :: Package gui :: Module car_map :: Class CarMap
[hide private]
[frames] | no frames]

Class CarMap

source code

object --+
         |
        CarMap

A "car map" is the map shown in a CarSim application window. It may contain any number of cars which are drawn onto the map. A car map listens for mouse commands that signal the creation of cars or execution of car methods. A yellow line on the car map shows the most recent movement of a car.

Instance Methods [hide private]
 
__init__(self, parent, width, height, grid_row, grid_column)
Constructor
source code
 
update_status_text(self, event) source code
 
drive_selected_car(self, event) source code
 
create_menu(self, event) source code
 
fuel(self) source code
 
fill_up(self) source code
 
create_new_car(self, event) source code
 
show_text(self, event) source code
 
hide_text(self, event) source code
 
save_location(self, event) source code
 
get_closest_car(self, location) source code
 
get_message_text(self, car)
Formats a car for string output.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent, width, height, grid_row, grid_column)
(Constructor)

source code 

Constructor

Overrides: object.__init__

get_message_text(self, car)

source code 

Formats a car for string output.

Parameters:
  • car - a car
Returns:
a string representation of the car