public static int IndexToLocalId(this Tileset tileset, int xIndex, int yIndex) { return xIndex + yIndex * tileset.GetNumberOfTilesWide(); }