Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make Point struct understand += operator

Tags:

c#

xna

I'd like to know if it is possible to extend Microsoft.XNA.Framework.Point struct to work with +, +=, - and -= operators. Microsoft.XNA.Framework.Vector2 has a ton of operators, whereas Point has bare minimum.

like image 957
user1306322 Avatar asked Nov 18 '25 16:11

user1306322


1 Answers

It is only possible to add such an operator overload from the type's definition. You cannot add an overload from your code to that framework type.

like image 137
Servy Avatar answered Nov 20 '25 05:11

Servy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!