コード例 #1
0
 public void Dispose()
 {
     if (obstacleManager != null) {
         obstacleManager.Dispose();
         obstacleManager = null;
     }
 }
コード例 #2
0
        public void Initialize(Behavior b)
        {
            SimpleStayInLaneBehavior sb = (SimpleStayInLaneBehavior)b;

            // store the base path
            basePath = ConvertPath(sb.BasePath);

            // get the lower, upper bound
            leftBound = FindBoundary(sb.LaneWidth/2);
            rightBound = FindBoundary(-sb.LaneWidth/2);

            // convert everything to be vehicle relative
            AbsoluteTransformer absTransform = Services.StateProvider.GetAbsoluteTransformer();
            pathTime = absTransform.Timestamp;

            basePath = basePath.Transform(absTransform);
            leftBound = leftBound.Transform(absTransform);
            rightBound = rightBound.Transform(absTransform);

            // send the left and right bounds
            Services.UIService.PushRelativePath(leftBound, pathTime, "left bound");
            Services.UIService.PushRelativePath(rightBound, pathTime, "right bound");

            maxSpeed = sb.MaxSpeed;

            obstacleManager = new ObstacleManager();	// hik
        }