Beispiel #1
0
 public void WriteDownDecision(string path)
 {
     using (StreamWriter writer = new StreamWriter(path))
     {
         NewPositions.ForEach(x => writer.WriteLine(x.ToString()));
         if (Attacking)
         {
             writer.WriteLine(Attack.ToString());
         }
     }
 }
Beispiel #2
0
        public void Poll()
        {
            if (isBusy || isReleased || streamingHosts.Count == 0)
            {
                return;
            }

            isBusy = true;

            long newPositions = 0;

            foreach (StreamingHost sh in streamingHosts)
            {
                int isBigger = sh.HasChanged();
                if (isBigger > 0)
                {
                    if (sh.LastMaxLine == LoglineObject.ReadLine(sh.LastMaxLogPosition))
                    {
                        newPositions += ScanFile(null, 0, sh);
                    }
                    else
                    {
                        SetInconsistent();
                        return;
                    }
                }
                else if (isBigger < 0)
                {
                    SetInconsistent();
                    return;
                }
            }

            if (newPositions > 0 && NewPositions != null)
            {
                MainForm.FlashTrayIcon();
                NewPositions.Invoke(this, EventArgs.Empty);
            }
            isBusy = false;
        }
        public int AppendNewVertex(DMesh3 mesh, int vid)
        {
            int idx = ModifiedV.Length;

            ModifiedV.Add(vid);
            OldPositions.Add(mesh.GetVertex(vid));
            NewPositions.Add(OldPositions[idx]);
            if (NewNormals != null)
            {
                OldNormals.Add(mesh.GetVertexNormal(vid));
                NewNormals.Add(OldNormals[idx]);
            }
            if (NewColors != null)
            {
                OldColors.Add(mesh.GetVertexColor(vid));
                NewColors.Add(OldColors[idx]);
            }
            if (NewUVs != null)
            {
                OldUVs.Add(mesh.GetVertexUV(vid));
                NewUVs.Add(OldUVs[idx]);
            }
            return(idx);
        }
 private void RealTraderOnNewPositions(IEnumerable <Position> positions)
 {
     NewPositions.SafeInvoke(this, new PositionsEventArgs(positions));
 }
Beispiel #5
0
 private void RaiseNewPosition(Position position)
 {
     NewPosition?.Invoke(position);
     NewPositions?.Invoke(new[] { position });
 }
Beispiel #6
0
 private void NewPositionsHandler(IEnumerable <Position> positions)
 {
     AddGuiAction(() => NewPositions.SafeInvoke(positions));
 }
Beispiel #7
0
 /// <summary>
 /// To call the event <see cref="Connector.NewPositions"/>.
 /// </summary>
 /// <param name="positions">Positions that should be passed to the event.</param>
 private void RaiseNewPositions(IEnumerable <Position> positions)
 {
     NewPositions.SafeInvoke(positions);
 }