We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I would like to be able to specify points in an easier way.
Therefore, I suggest adding an implicit conversion between a ValueTuple and a SKPoint as well as a deconstructor:
SKPoint
// In struct SKPoint public static implicit operator SKPoint((float x, float y) tuple) => new SKPoint(tuple.x, tuple.y); public void Deconstruct(out float x, out float y) => (x = X, y = Y);
This would allow us to define a point as SKPoint point = (x, y); instead of SKPoint point = new SKPoint(x, y);.
SKPoint point = (x, y);
SKPoint point = new SKPoint(x, y);
The inverse would also be possible: var (x, y) = point;.
var (x, y) = point;
It is currently (C#12) not possible to declare operators as extension methods.
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is your feature request related to a problem?
I would like to be able to specify points in an easier way.
Describe the solution you would like
Therefore, I suggest adding an implicit conversion between a ValueTuple and a
SKPoint
as well as a deconstructor:This would allow us to define a point as
SKPoint point = (x, y);
instead ofSKPoint point = new SKPoint(x, y);
.The inverse would also be possible:
var (x, y) = point;
.Describe alternatives you have considered
It is currently (C#12) not possible to declare operators as extension methods.
Additional context
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: