Vector2D ToString Method Delta Engine Documentation

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

public override string ToString()

Return Value

Type: String
Remarks

Tests: DeltaEngine.Tests.Datatypes.Vector2DTests
Examples

2 unit tests call DeltaEngine.Datatypes.Vector2D.ToString
[Test]
public void PointToString()
{
    Assert.AreEqual("3, 4", new Vector2D(3, 4).ToString());
}
[Test]
public void PointToStringAndFromString()
{
    var v = new Vector2D(2.23f, 3.45f);
    string pointString = v.ToString();
    Assert.AreEqual(v, new Vector2D(pointString));
    Assert.Throws<Vector2D.InvalidNumberOfComponents>(() => new Vector2D("0.0"));
}
See Also