1
0
mirror of synced 2024-11-15 01:33:51 +00:00
PettingZoo/PettingZoo.Core/Validation/TextPosition.cs
Mark van Renswoude c75ea0cc62 Implemented DataAnnotation based validation for Tapeti messages
Fixed class name missing when selecting from Tapeti class
Added Filter to class selection dialog
Fixed or removed some minor todo's
2022-01-03 15:04:00 +01:00

44 lines
980 B
C#

using System;
namespace PettingZoo.Core.Validation
{
public readonly struct TextPosition : IEquatable<TextPosition>
{
public int Row { get; }
public int Column { get; }
public TextPosition(int row, int column)
{
Row = row;
Column = column;
}
public bool Equals(TextPosition other)
{
return Row == other.Row && Column == other.Column;
}
public override bool Equals(object? obj)
{
return obj is TextPosition other && Equals(other);
}
public override int GetHashCode()
{
return HashCode.Combine(Row, Column);
}
public static bool operator ==(TextPosition left, TextPosition right)
{
return left.Equals(right);
}
public static bool operator !=(TextPosition left, TextPosition right)
{
return !(left == right);
}
}
}