XNA / C# extend a class to make it castable
i want to extend a class(Vector2) to make it castable to a Point. How do i
do that?
parts of the problem:
1. extend a class
2. make a class castable to another class
in the end i want to be able to do this:
Vector2 foo = new Vector2(5.2f);//X = 5.2f Y = 5.2F
Point red = new Point(2,2);//X = 2 Y = 2
red = foo;//I know that you can make classes convert themselfs
automaticly... somehow?
//Now red.X = 5 red.Y = 5
No comments:
Post a Comment