Merge pull request #58827 from XPhyro/cs-deconstruct

Implement `Deconstruct` methods for C# vectors
This commit is contained in:
Rémi Verschelde 2022-03-06 22:36:45 +01:00 committed by GitHub
commit 47f1c4f900
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 0 deletions

View file

@ -81,6 +81,15 @@ namespace Godot
}
}
/// <summary>
/// Helper method for deconstruction into a tuple.
/// </summary>
public void Deconstruct(out real_t x, out real_t y)
{
x = this.x;
y = this.y;
}
internal void Normalize()
{
real_t lengthsq = LengthSquared();

View file

@ -81,6 +81,15 @@ namespace Godot
}
}
/// <summary>
/// Helper method for deconstruction into a tuple.
/// </summary>
public void Deconstruct(out int x, out int y)
{
x = this.x;
y = this.y;
}
/// <summary>
/// Returns a new vector with all components in absolute values (i.e. positive).
/// </summary>

View file

@ -96,6 +96,16 @@ namespace Godot
}
}
/// <summary>
/// Helper method for deconstruction into a tuple.
/// </summary>
public void Deconstruct(out real_t x, out real_t y, out real_t z)
{
x = this.x;
y = this.y;
z = this.z;
}
internal void Normalize()
{
real_t lengthsq = LengthSquared();

View file

@ -96,6 +96,16 @@ namespace Godot
}
}
/// <summary>
/// Helper method for deconstruction into a tuple.
/// </summary>
public void Deconstruct(out int x, out int y, out int z)
{
x = this.x;
y = this.y;
z = this.z;
}
/// <summary>
/// Returns a new vector with all components in absolute values (i.e. positive).
/// </summary>