Beispiel #1
0
 private void Refresh(TimeSpan totalgameTime)
 {
     if ((totalgameTime - previousRefreshTime) > TimeSpan.FromMilliseconds(50))
     {
         previousRefreshTime = totalgameTime;
         mainwow.TryToRefreshObjectManager();
         WoWObject.GetAllObjects(ref allUnits, ref allSpells, ref allPlayers, mainwow);
         mainPlayer.RefreshFromList(allPlayers, mainPlayer.WindowTitle);
         WoWPlayer.SetWindowTitleForPlayer(ref allPlayers, mainPlayer.Guid, mainwow.WindowTitle);
         foreach (WoWPlayer wp in allPlayers)
         {
             if (wp.WindowTitle != null && Vector2.Distance(wp.MovementTarget, new Vector2(wp.Position.X, wp.Position.Y)) < 80)
             {
                 if (MoveController.RotateTowards(wp, wp.MovementTarget, (double)0.06 * Math.PI, true))
                 {
                     MoveController.WalkingTowards(wp, wp.MovementTarget, 5);
                 }
             }
         }
     }
 }