checkpoint
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
namespace Shogi.Domain.YetToBeAssimilatedIntoDDD.Pathing;
|
||||
|
||||
public static class Direction
|
||||
{
|
||||
public static readonly Vector2 Forward = new(0, 1);
|
||||
public static readonly Vector2 Backward = new(0, -1);
|
||||
public static readonly Vector2 Left = new(-1, 0);
|
||||
public static readonly Vector2 Right = new(1, 0);
|
||||
public static readonly Vector2 ForwardLeft = new(-1, 1);
|
||||
public static readonly Vector2 ForwardRight = new(1, 1);
|
||||
public static readonly Vector2 BackwardLeft = new(-1, -1);
|
||||
public static readonly Vector2 BackwardRight = new(1, -1);
|
||||
public static readonly Vector2 KnightLeft = new(-1, 2);
|
||||
public static readonly Vector2 KnightRight = new(1, 2);
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
namespace Shogi.Domain.YetToBeAssimilatedIntoDDD.Pathing;
|
||||
|
||||
public enum Distance
|
||||
{
|
||||
/// <summary>
|
||||
/// Signifies that a piece can move one tile/position per move.
|
||||
/// </summary>
|
||||
OneStep,
|
||||
/// <summary>
|
||||
/// Signifies that a piece can move multiple tiles/positions in a single move.
|
||||
/// </summary>
|
||||
MultiStep
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace Shogi.Domain.YetToBeAssimilatedIntoDDD.Pathing;
|
||||
|
||||
[DebuggerDisplay("{Step} - {Distance}")]
|
||||
public record Path
|
||||
{
|
||||
public Vector2 Step { get; }
|
||||
public Vector2 NormalizedStep => Vector2.Normalize(Step);
|
||||
public Distance Distance { get; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="step">The smallest distance that can occur during a move.</param>
|
||||
/// <param name="distance"></param>
|
||||
public Path(Vector2 step, Distance distance = Distance.OneStep)
|
||||
{
|
||||
Step = step;
|
||||
this.Distance = distance;
|
||||
}
|
||||
|
||||
public Path Invert() => new(Vector2.Negate(Step), Distance);
|
||||
}
|
||||
Reference in New Issue
Block a user