checkpoint

This commit is contained in:
2025-09-05 18:13:35 -05:00
parent e2a8b771d9
commit 0a415a2292
24 changed files with 622 additions and 492 deletions

View File

@@ -32,3 +32,9 @@ public enum WhichPiece
Pawn,
//PromotedPawn,
}
public enum WhichPlayer
{
Player1,
Player2
}

View File

@@ -1,4 +1,4 @@
namespace Shogi.Domain.YetToBeAssimilatedIntoDDD.Pathing;
namespace Shogi.Domain.ValueObjects;
public static class Direction
{

View File

@@ -1,4 +1,4 @@
namespace Shogi.Domain.YetToBeAssimilatedIntoDDD.Pathing;
namespace Shogi.Domain.ValueObjects;
public enum Distance
{

View File

@@ -1,6 +1,6 @@
using System.Diagnostics;
namespace Shogi.Domain.YetToBeAssimilatedIntoDDD.Pathing;
namespace Shogi.Domain.ValueObjects.Movement;
[DebuggerDisplay("{Step} - {Distance}")]
public record Path
@@ -17,7 +17,7 @@ public record Path
public Path(Vector2 step, Distance distance = Distance.OneStep)
{
Step = step;
this.Distance = distance;
Distance = distance;
}
public Path Invert() => new(Vector2.Negate(Step), Distance);

View File

@@ -1,4 +1,4 @@
using Shogi.Domain.YetToBeAssimilatedIntoDDD.Pathing;
using Shogi.Domain.ValueObjects.Movement;
using System.Collections.ObjectModel;
namespace Shogi.Domain.ValueObjects

View File

@@ -1,4 +1,4 @@
using Shogi.Domain.YetToBeAssimilatedIntoDDD.Pathing;
using Shogi.Domain.ValueObjects.Movement;
using System.Collections.ObjectModel;
namespace Shogi.Domain.ValueObjects;

View File

@@ -1,4 +1,4 @@
using Shogi.Domain.YetToBeAssimilatedIntoDDD.Pathing;
using Shogi.Domain.ValueObjects.Movement;
using System.Collections.ObjectModel;
namespace Shogi.Domain.ValueObjects;

View File

@@ -1,4 +1,4 @@
using Shogi.Domain.YetToBeAssimilatedIntoDDD.Pathing;
using Shogi.Domain.ValueObjects.Movement;
using System.Collections.ObjectModel;
namespace Shogi.Domain.ValueObjects

View File

@@ -1,4 +1,4 @@
using Shogi.Domain.YetToBeAssimilatedIntoDDD.Pathing;
using Shogi.Domain.ValueObjects.Movement;
using System.Collections.ObjectModel;
namespace Shogi.Domain.ValueObjects

View File

@@ -1,4 +1,4 @@
using Shogi.Domain.YetToBeAssimilatedIntoDDD.Pathing;
using Shogi.Domain.ValueObjects.Movement;
using System.Collections.ObjectModel;
namespace Shogi.Domain.ValueObjects

View File

@@ -1,4 +1,4 @@
using Shogi.Domain.YetToBeAssimilatedIntoDDD.Pathing;
using Shogi.Domain.ValueObjects.Movement;
using System.Diagnostics;
namespace Shogi.Domain.ValueObjects

View File

@@ -1,4 +1,4 @@
using Shogi.Domain.YetToBeAssimilatedIntoDDD.Pathing;
using Shogi.Domain.ValueObjects.Movement;
using System.Collections.ObjectModel;
namespace Shogi.Domain.ValueObjects;

View File

@@ -1,4 +1,4 @@
using Shogi.Domain.YetToBeAssimilatedIntoDDD.Pathing;
using Shogi.Domain.ValueObjects.Movement;
using System.Collections.ObjectModel;
namespace Shogi.Domain.ValueObjects

View File

@@ -1,4 +1,5 @@
using Shogi.Domain.YetToBeAssimilatedIntoDDD;
using Shogi.Domain.ValueObjects.Movement;
using Shogi.Domain.YetToBeAssimilatedIntoDDD;
namespace Shogi.Domain.ValueObjects;
/// <summary>
@@ -247,7 +248,7 @@ public sealed class ShogiBoard(BoardState initialState)
{
var list = new List<Vector2>(10);
var position = path.Step + piecePosition;
if (path.Distance == YetToBeAssimilatedIntoDDD.Pathing.Distance.MultiStep)
if (path.Distance == Distance.MultiStep)
{
while (position.IsInsideBoardBoundary())
@@ -340,7 +341,7 @@ public sealed class ShogiBoard(BoardState initialState)
else
{
var multiStepPaths = matchingPaths
.Where(path => path.Distance == YetToBeAssimilatedIntoDDD.Pathing.Distance.MultiStep)
.Where(path => path.Distance == Distance.MultiStep)
.ToArray();
if (multiStepPaths.Length == 0)
{
@@ -371,7 +372,7 @@ public sealed class ShogiBoard(BoardState initialState)
return new MoveResult(true);
}
private static IEnumerable<Vector2> GetPositionsAlongPath(Vector2 from, Vector2 to, YetToBeAssimilatedIntoDDD.Pathing.Path path)
private static IEnumerable<Vector2> GetPositionsAlongPath(Vector2 from, Vector2 to, Path path)
{
var next = from;
while (next != to && next.X >= 0 && next.X < 9 && next.Y >= 0 && next.Y < 9)

View File

@@ -1,8 +0,0 @@
namespace Shogi.Domain.ValueObjects
{
public enum WhichPlayer
{
Player1,
Player2
}
}