     @_refreshPosition()
     @currentStreetDirection = StreetDirection.CROSS
     @currentAnimation = null
+
+  _stopAnimation: () ->
+    if @currentAnimation?
+      clearTimeout(@currentAnimation)
+      @currentAnimation = null
 
   _refreshPosition: () ->
     @source.attr('x', @currentPosition.getX() - @carWidth / 2)

  requestMove: (target) ->
    return unless @grid.isWithinAStreet(target)

    if @currentAnimation?
      clearTimeout(@currentAnimation)
      @currentAnimation = null

    @_moveTo(@grid.realign(target))
class Car
  MAX_CALL_STACK = 30

  class StreetDirection
    @CROSS = 0
    @HORIZONTAL = 1
