Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gwoodhouse/a5feb0ce5d8443b77c1619374260f275 to your computer and use it in GitHub Desktop.
Save gwoodhouse/a5feb0ce5d8443b77c1619374260f275 to your computer and use it in GitHub Desktop.
public static T? forXY<T>(this T[,] grid, Action<int, int> action) where T : class
{
for (int y = 0; y < grid.getHeight(); y++)
{
for (int x = 0; x < grid.getWidth(); x++)
{
action(x, y);
}
}
return null;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment