public static SteerLocation getTarget(SteeringBehavior behavior){ SteerLocation targetL = null; if(behavior instanceof Face) targetL = (SteerLocation)((Face) behavior).getTarget(); else if(behavior instanceof Arrive) targetL = (SteerLocation)((Arrive) behavior).getTarget(); else if(behavior instanceof Seek) targetL = (SteerLocation)((Seek) behavior).getTarget(); return targetL; }