mirror of
https://github.com/ZuneDev/MicrosoftIris.git
synced 2026-07-27 13:13:29 -07:00
Implement more IStringEncodable
This commit is contained in:
@@ -9,7 +9,7 @@ using System;
|
||||
namespace Microsoft.Iris.Render
|
||||
{
|
||||
[Serializable]
|
||||
public struct Point
|
||||
public struct Point : IStringEncodable
|
||||
{
|
||||
private int m_x;
|
||||
private int m_y;
|
||||
@@ -84,5 +84,7 @@ namespace Microsoft.Iris.Render
|
||||
public Size ToSize() => new Size(this.X, this.Y);
|
||||
|
||||
public static Point Negate(Point point) => new Point(-point.X, -point.Y);
|
||||
|
||||
public string EncodeString() => $"{X}, {Y}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ using System.Text;
|
||||
namespace Microsoft.Iris.Render
|
||||
{
|
||||
[Serializable]
|
||||
public struct Vector2
|
||||
public struct Vector2 : IStringEncodable
|
||||
{
|
||||
private float m_x;
|
||||
private float m_y;
|
||||
@@ -107,5 +107,7 @@ namespace Microsoft.Iris.Render
|
||||
}
|
||||
|
||||
public bool IsApproximate(Vector2 vector) => Math2.WithinEpsilon(this.m_x, vector.m_x) && Math2.WithinEpsilon(this.m_y, vector.m_y);
|
||||
|
||||
public string EncodeString() => $"{X}, {Y}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ using System.Text;
|
||||
namespace Microsoft.Iris.Render
|
||||
{
|
||||
[Serializable]
|
||||
public struct Vector3
|
||||
public struct Vector3 : IStringEncodable
|
||||
{
|
||||
private float m_x;
|
||||
private float m_y;
|
||||
@@ -130,5 +130,7 @@ namespace Microsoft.Iris.Render
|
||||
}
|
||||
|
||||
public bool IsApproximate(Vector3 vector) => Math2.WithinEpsilon(this.m_x, vector.m_x) && Math2.WithinEpsilon(this.m_y, vector.m_y) && Math2.WithinEpsilon(this.m_z, vector.m_z);
|
||||
|
||||
public string EncodeString() => $"{X}, {Y}, {Z}";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user