Add new Views system

This commit is contained in:
Marvin Rohrbach
2018-12-16 11:47:26 +01:00
parent 624f6d1ea6
commit 35e3010a33
9 changed files with 338 additions and 191 deletions

View File

@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace CoopSweeper.View
{
public struct Position
{
public Position(int x, int y)
{
X = x;
Y = y;
}
public int X { get; set; }
public int Y { get; set; }
public override bool Equals(object obj)
{
if (!(obj is Position))
return false;
var position = (Position)obj;
return X == position.X &&
Y == position.Y;
}
public override int GetHashCode()
{
var hashCode = 1861411795;
hashCode = hashCode * -1521134295 + X.GetHashCode();
hashCode = hashCode * -1521134295 + Y.GetHashCode();
return hashCode;
}
public static bool operator ==(Position a, Position b) => a.X == b.X && a.Y == b.Y;
public static bool operator !=(Position a, Position b) => a.X != b.X || a.Y != b.Y;
}
}