2015-11-11 19:48:50 +01:00
|
|
|
|
// XAML Map Control - http://xamlmapcontrol.codeplex.com/
|
2016-02-23 20:07:30 +01:00
|
|
|
|
// © 2016 Clemens Fischer
|
2015-11-11 19:48:50 +01:00
|
|
|
|
// Licensed under the Microsoft Public License (Ms-PL)
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
|
|
namespace MapControl
|
|
|
|
|
|
{
|
|
|
|
|
|
public class TileGrid : IEquatable<TileGrid>
|
|
|
|
|
|
{
|
|
|
|
|
|
public readonly int ZoomLevel;
|
|
|
|
|
|
public readonly int XMin;
|
|
|
|
|
|
public readonly int YMin;
|
|
|
|
|
|
public readonly int XMax;
|
|
|
|
|
|
public readonly int YMax;
|
|
|
|
|
|
|
|
|
|
|
|
public TileGrid(int zoomLevel, int xMin, int yMin, int xMax, int yMax)
|
|
|
|
|
|
{
|
|
|
|
|
|
ZoomLevel = zoomLevel;
|
|
|
|
|
|
XMin = xMin;
|
|
|
|
|
|
YMin = yMin;
|
|
|
|
|
|
XMax = xMax;
|
|
|
|
|
|
YMax = yMax;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool Equals(TileGrid tileGrid)
|
|
|
|
|
|
{
|
2016-01-14 17:56:25 +01:00
|
|
|
|
return ReferenceEquals(this, tileGrid)
|
|
|
|
|
|
|| (tileGrid != null
|
2015-11-11 19:48:50 +01:00
|
|
|
|
&& tileGrid.ZoomLevel == ZoomLevel
|
|
|
|
|
|
&& tileGrid.XMin == XMin
|
|
|
|
|
|
&& tileGrid.YMin == YMin
|
|
|
|
|
|
&& tileGrid.XMax == XMax
|
2016-01-14 17:56:25 +01:00
|
|
|
|
&& tileGrid.YMax == YMax);
|
2015-11-11 19:48:50 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Equals(obj as TileGrid);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
|
{
|
|
|
|
|
|
return ZoomLevel ^ XMin ^ YMin ^ XMax ^ YMax;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|