60 lines
1.3 KiB
C#
60 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace CzokoŚmieciarka.MonoGameView.DataModels.Models
|
|
{
|
|
public class Coords : ICloneable
|
|
{
|
|
public Coords(int x,int y)
|
|
{
|
|
this.X = x;
|
|
this.Y = y;
|
|
}
|
|
|
|
public int X { get; set; }
|
|
public int Y { get; set; }
|
|
|
|
public static bool operator == (Coords a, Coords b)
|
|
{
|
|
return a.X == b.X && a.Y == b.Y;
|
|
}
|
|
|
|
public static bool operator !=(Coords a, Coords b)
|
|
{
|
|
return !(a == b);
|
|
}
|
|
|
|
public static Coords operator + (Coords a, Coords b)
|
|
{
|
|
return new Coords(a.X + b.X, a.Y + b.Y);
|
|
}
|
|
public static Coords operator -(Coords a, Coords b)
|
|
{
|
|
return new Coords(a.X - b.X, a.Y - b.Y);
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return base.ToString();
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
return base.Equals(obj);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return base.GetHashCode();
|
|
}
|
|
|
|
public object Clone()
|
|
{
|
|
return new Coords(X, Y);
|
|
}
|
|
}
|
|
}
|