private void button_load_delta_Click(object sender, EventArgs e)
        {
            // Displays an OpenFileDialog so the user can select a Cursor.
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter = "Text Files|*.txt";
            openFileDialog.Title  = "Select a Text File";

            // Show the Dialog.
            // If the user clicked OK in the dialog and
            // a .CUR file was selected, open it.
            if (openFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                StreamReader sr = new StreamReader(openFileDialog.FileName);
                String       line;
                while ((line = sr.ReadLine()) != null)
                {
                    String[] posArray = line.Split();
                    ICoord   p        = initialPos.Clone();
                    p.X += Convert.ToDouble(posArray[0]);
                    p.Y += Convert.ToDouble(posArray[1]);
                    p.Z += Convert.ToDouble(posArray[2]);
                    marks.Add(p);
                    marksListBox.Items.Add(String.Format("[{0}]({0:0.00},{1:0.00},{2:0.00})", marks.Count, p.X, p.Y, p.Z));
                    outputTextBox.SelectionColor = Color.Green;
                    outputTextBox.AppendText(String.Format("Add mark [{0}]({0:0.00},{1:0.00},{2:0.00})\r\n", marks.Count, p.X, p.Y, p.Z));
                    outputTextBox.ScrollToCaret();
                }
                sr.Close();
                checkBoxZigZag.Checked = checkBoxZigZag.Enabled = false;
            }
        }
Exemple #2
0
 public override object Clone()
 {
     return(new Cavalier(Name, Couleur, (Coord)Coord.Clone())
     {
         Captured = Captured,
         Depart = Depart
     });
 }
Exemple #3
0
        public void Clone(Coord c1)
        {
            var c2 = (Coord)c1.Clone();

            Assert.That(c1, Is.Not.SameAs(c2));
            Assert.That(c1.Latitud, Is.EqualTo(c2.Latitud), nameof(c1.Latitud));
            Assert.That(c1.Longitud, Is.EqualTo(c2.Longitud), nameof(c1.Longitud));
        }
Exemple #4
0
        public void Equals_HappyPath(Coord c1)
        {
            var c2 = (Coord)c1.Clone();

            Assert.That(c1, Is.EqualTo(c2), "Is.EqualTo");
            Assert.IsTrue(c1.Equals(c2), "Equals method");
            Assert.IsTrue(c1 == c2, "operator==");
            Assert.IsFalse(c1 != c2, "operator!=");
        }
Exemple #5
0
 public void DoMoveTo(Coord coord)
 {
     pos = coord.Clone();
 }
 public TransformationComponent(BaseGameObject owner, Coord pos, Size size, short angle) : base(owner)
 {
     Pos   = (Coord)pos.Clone();
     Size  = (Size)size.Clone();
     Angle = angle;
 }
Exemple #7
0
 public Coordinates[] GetCoordinates()
 {
     return((Coordinates[])Coord.Clone());
 }
Exemple #8
0
        public void GetHashCode_HappyPath(Coord c1)
        {
            var c2 = ((Coord)c1.Clone()).GetHashCode();

            Assert.That(c1.GetHashCode(), Is.EqualTo(c2.GetHashCode()));
        }