I'm writing a C# forms game engine and now I am trying add a form of my own vector struct. I have created a working example but it can only take ints, or the data type that I make it to take. But I want to be able to use all of them, ints, floats & decimals but I don't know what to do...
I have tried making a different struct with a different name but that's all clunky and i want to try to keep all of them in a single struct (if it's possible).
public struct Vector2
{
public int X1;
public int Y1;
public Vector2(int x1, int y1)
{
X1 = x1;
Y1 = y1;
}
// Another vector2 that takes floats.
// a third one that takes decimals
}
Any form of help is appreciated! And excuse my English.