Exemple #1
0
        public void FulfillDonePathFindRequests(NetPeer netPeer, NetConnection connection)
        {
            lock (PathFindRequest.DonePathFindRequestsLock)
            {
                while (PathFindRequest.DonePathFindRequests.Count > 0)
                {
                    PathFindRequest request = PathFindRequest.DonePathFindRequests.Dequeue();
                    request.Command.WayPoints  = request.WayPoints;
                    request.Command.Calculated = true;
                    //if (!request.AvoidUnits)
                    //    pathfinder.SmoothPath(request.Command.WayPoints, request.Unit);

                    /*NetOutgoingMessage msg = netPeer.CreateMessage();
                     * msg.Write(MessageID.PATH_UPDATE);
                     * //msg.Write(request.Command.ID);
                     * msg.Write(request.Command.Unit.ID);
                     * msg.Write(request.Command.Unit.Team);
                     * msg.Write((short)request.Command.Destination.X);
                     * msg.Write((short)request.Command.Destination.Y);
                     * msg.Write((short)request.Command.WayPoints.Count);
                     *
                     * foreach (Vector2 wayPoint in request.Command.WayPoints)
                     * {
                     *  msg.Write((short)wayPoint.X);
                     *  msg.Write((short)wayPoint.Y);
                     * }
                     * netPeer.SendMessage(msg, connection, NetDeliveryMethod.ReliableOrdered);*/
                }
            }
        }
Exemple #2
0
 public void FulfillDonePathFindRequests()
 {
     lock (PathFindRequest.DonePathFindRequestsLock)
     {
         while (PathFindRequest.DonePathFindRequests.Count > 0)
         {
             PathFindRequest request = PathFindRequest.DonePathFindRequests.Dequeue();
             request.Command.WayPoints  = request.WayPoints;
             request.Command.Calculated = true;
             //if (!request.AvoidUnits)
             //    pathfinder.SmoothPath(request.Command.WayPoints, request.Unit);
         }
     }
 }