protected PointTrack addNewTrack ( int setIndex , double x , double y , Desc desc ) { PointTrack p = getUnused ( ) ; p . set ( x , y ) ; ( ( Desc ) p . getDescription ( ) ) . setTo ( desc ) ; if ( checkValidSpawn ( setIndex , p ) ) { p . setId = setIndex ; p . featureId = featureID ++ ; sets [ setIndex ] . tracks . add ( p ) ; tracksNew . add ( p ) ; tracksActive . add ( p ) ; tracksAll . add ( p ) ; return p ; } else { unused . add ( p ) ; return null ; } }
Adds a new track given its location and description