GraphLine RemoveAt Method Delta Engine Documentation

Namespace: DeltaEngine.Rendering2D.Graphs
Assembly: DeltaEngine.Rendering2D.Graphs (in DeltaEngine.Rendering2D.Graphs.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void RemoveAt(
	int index
)
Remarks

Tests: DeltaEngine.Rendering2D.Graphs.Tests.GraphLineTests
Examples

3 unit tests call DeltaEngine.Rendering2D.Graphs.GraphLine.RemoveAt(System.Int32)
[Test, CloseAfterFirstFrame]
public void RemoveFirstPoint()
{
    GraphLine line = CreateLineWithThreePoints();
    line.RemoveAt(0);
    Assert.AreEqual(2, line.points.Count);
    Assert.AreEqual(1, line.lines.Count);
    Assert.AreEqual(new Vector2D(0.6f, 0.7f), line.points[0]);
    Assert.AreEqual(new Vector2D(0.8f, 0.4f), line.points[1]);
    Assert.IsTrue(line.lines[0].StartPoint.IsNearlyEqual(new Vector2D(0.538f, 0.462f)));
    Assert.IsTrue(line.lines[0].EndPoint.IsNearlyEqual(new Vector2D(0.6143f, 0.519f)));
}
[Test, CloseAfterFirstFrame]
public void RemoveMiddlePoint()
{
    GraphLine line = CreateLineWithThreePoints();
    line.RemoveAt(1);
    Assert.AreEqual(2, line.points.Count);
    Assert.AreEqual(1, line.lines.Count);
    Assert.AreEqual(new Vector2D(0.4f, 0.5f), line.points[0]);
    Assert.AreEqual(new Vector2D(0.8f, 0.4f), line.points[1]);
    Assert.IsTrue(line.lines[0].StartPoint.IsNearlyEqual(new Vector2D(0.462f, 0.5f)));
    Assert.IsTrue(line.lines[0].EndPoint.IsNearlyEqual(new Vector2D(0.6143f, 0.519f)));
}
[Test, CloseAfterFirstFrame]
public void RemoveLastPoint()
{
    GraphLine line = CreateLineWithThreePoints();
    line.RemoveAt(2);
    Assert.AreEqual(2, line.points.Count);
    Assert.AreEqual(1, line.lines.Count);
    Assert.IsTrue(line.lines[0].StartPoint.IsNearlyEqual(new Vector2D(0.462f, 0.5f)));
    Assert.IsTrue(line.lines[0].EndPoint.IsNearlyEqual(new Vector2D(0.538f, 0.462f)));
}
See Also