Created
November 16, 2018 09:18
-
-
Save JamesKim2998/f88c05299e9c7dfc36e2cf35ad1bbf43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct CustomVector2 | |
{ | |
public int X; | |
public int Y; | |
public CustomVector2(int x, int y) | |
{ | |
X = x; | |
Y = y; | |
} | |
public static implicit operator CustomVector2((int, int) valueTuple) | |
{ | |
return new CustomVector2(valueTuple.Item1, valueTuple.Item2); | |
} | |
} | |
public void Foo(CustomVector2 v) | |
{ | |
// Do something. | |
} | |
public void Bar(params CustomVector2[] v) | |
{ | |
// Do something. | |
} | |
public void Main() | |
{ | |
Foo((0, 0)); | |
Bar((0, 0), (0, 1), (1, 1), (2, 2)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment