Sudoku/Complete/Models/IntegerPoint.cs

40 lines
826 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SudokuWeek4.Models
{
internal struct IntegerPoint
{
public int X;
public int Y;
public IntegerPoint(int x, int y)
{
X = x;
Y = y;
}
// Check if the given objectPoint is an IntegerPoint
public override bool Equals(object objectPoint)
{
if( objectPoint == null || objectPoint.GetType() != typeof(IntegerPoint) )
return false;
return Equals((IntegerPoint)objectPoint);
}
// Check if the X and Y are equal to eachother
public bool Equals(IntegerPoint objectPoint)
{
return objectPoint.X == X && objectPoint.Y == Y;
}
// We do not need this (just to have all the overrides)
public override int GetHashCode()
{
return 0;
}
}
}