Exemple #1
0
        public static Vector2FArrayList CreateRandomVector2FArray(int count, IFloatRandomNumberGenerator r)
        {
            Vector2FArrayList result = new Vector2FArrayList(count);

            for (int i = 0; i < count; i++)
            {
                result.Add(new Vector2F(r.NextFloat(), r.NextFloat()));
            }
            return(result);
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Polygon"/> class using coordinates from another instance.
 /// </summary>
 /// <param name="polygon">A <see cref="Polygon"/> instance.</param>
 public Polygon(Polygon polygon)
 {
     _points = (Vector2FArrayList)polygon._points.Clone();
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Polygon"/> class with serialized data.
 /// </summary>
 /// <param name="info">The object that holds the serialized object data.</param>
 /// <param name="context">The contextual information about the source or destination.</param>
 private Polygon(SerializationInfo info, StreamingContext context)
 {
     _points = (Vector2FArrayList)info.GetValue("Points", typeof(Vector2FArrayList));
 }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Polygon"/> class using an array of coordinates.
 /// </summary>
 /// <param name="points">An <see cref="Vector2FArrayList"/> instance.</param>
 public Polygon(Vector2FArrayList points)
 {
     _points.AddRange(points);
 }