// // Position.cs // // Copyright (c) František Boháček. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System.Diagnostics.CodeAnalysis; namespace NosSmooth.Game.Data.Info; /// /// Represents nostale position on map. /// [SuppressMessage("StyleCop.CSharp.NamingRules", "SA1313", MessageId = "Parameter names should begin with lower-case letter", Justification = "Standard.")] public record struct Position(long X, long Y) { /// /// Get the squared distance to the given position. /// /// The position. /// The distance squared. public long DistanceSquared(Position position) { return ((position.X - X) * (position.X - X)) + ((position.Y - Y) * (position.Y - Y)); } }