예제 #1
0
            public Node(Point3D position, VehicleAction from)
            {
                Position   = position;
                FromAction = from;

                Car = new VehicleState(new Point(position.X, position.Y), position.Z);
            }
예제 #2
0
        internal LinkedList <VehicleAction> CombineAction(LinkedList <VehicleAction> actions)
        {
            LinkedList <VehicleAction> combinedActions = new LinkedList <VehicleAction>();
            VehicleAction combinedAction = new VehicleAction();

            combinedAction.ActionDirection = actions.First.Value.ActionDirection;
            combinedAction.Parameter       = 0;
            foreach (VehicleAction action in actions)
            {
                if (combinedAction.ActionDirection == action.ActionDirection)
                {
                    combinedAction.Parameter += action.Parameter;
                }
                else //动作序列完成
                {
                    combinedActions.AddLast(combinedAction);

                    combinedAction = new VehicleAction();
                    combinedAction.ActionDirection = action.ActionDirection;
                    combinedAction.Parameter       = action.Parameter;
                }
            }
            combinedActions.AddLast(combinedAction);

            return(combinedActions);
        }