2019-03-13 14:19:38 +01:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
2019-04-22 09:24:16 +02:00
|
|
|
|
namespace CzokoŚmieciarka.MonoGameView.DataModels.Models
|
2019-03-13 14:19:38 +01:00
|
|
|
|
{
|
|
|
|
|
public class Coords
|
|
|
|
|
{
|
|
|
|
|
public Coords(int x,int y)
|
|
|
|
|
{
|
|
|
|
|
this.X = x;
|
|
|
|
|
this.Y = y;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int X { get; set; }
|
|
|
|
|
public int Y { get; set; }
|
|
|
|
|
|
2019-03-13 15:31:33 +01:00
|
|
|
|
public static bool operator == (Coords a, Coords b)
|
|
|
|
|
{
|
|
|
|
|
return a.X == b.X && a.Y == b.Y;
|
|
|
|
|
}
|
2019-03-13 14:19:38 +01:00
|
|
|
|
|
2019-03-13 15:31:33 +01:00
|
|
|
|
public static bool operator !=(Coords a, Coords b)
|
|
|
|
|
{
|
|
|
|
|
return !(a == b);
|
|
|
|
|
}
|
2019-03-26 19:37:23 +01:00
|
|
|
|
|
2019-04-08 17:07:08 +02:00
|
|
|
|
public static Coords operator + (Coords a, Coords b)
|
|
|
|
|
{
|
|
|
|
|
return new Coords(a.X + b.X, a.Y + b.Y);
|
2019-03-26 19:37:23 +01:00
|
|
|
|
}
|
2019-04-08 17:07:08 +02:00
|
|
|
|
public static Coords operator -(Coords a, Coords b)
|
|
|
|
|
{
|
|
|
|
|
return new Coords(a.X - b.X, a.Y - b.Y);
|
2019-04-22 09:24:16 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return base.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object obj)
|
|
|
|
|
{
|
|
|
|
|
return base.Equals(obj);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override int GetHashCode()
|
|
|
|
|
{
|
|
|
|
|
return base.GetHashCode();
|
|
|
|
|
}
|
2019-03-13 14:19:38 +01:00
|
|
|
|
}
|
|
|
|
|
}
|