Closed TriHuynh00 closed 3 years ago
The list of vehicles is AccidentConstructor.vehicleList
Since this is an ArrayList<VehicleAttr>
, Vuong can loop through each VehicleAttr
element of the list to get the moving direction and damaged component as follows:
To get the moving direction, use getTravellingDirection()
. This will return a String
To get the list of damaged component, use getDamagedComponents()
. This will return a LinkedList<String>
The returned value can then be added into the JSON object
Find the code piece where Vuong can extract crash component and moving direction of the vehicle