Black box sim engine (commands in, events out) with 3 piece types (Rook, Bishop, Knight), cargo transfer system with social status priority, collision detection, and victory/defeat conditions. 57 tests covering rules, simulation, loading, and solvability. Godot 4 presentation layer scaffolding.
17 lines
566 B
C#
17 lines
566 B
C#
using Chessistics.Engine.Model;
|
|
|
|
namespace Chessistics.Engine.Rules;
|
|
|
|
public static class VictoryChecker
|
|
{
|
|
public static bool AllDemandsMet(BoardState state)
|
|
=> state.Demands.Values.All(d => d.IsSatisfied);
|
|
|
|
public static bool AnyDeadlineExpired(BoardState state)
|
|
=> state.TurnNumber > state.MaxDeadline && !AllDemandsMet(state);
|
|
|
|
public static IReadOnlyList<DemandState> GetExpiredDemands(BoardState state)
|
|
=> state.Demands.Values
|
|
.Where(d => !d.IsSatisfied && state.TurnNumber > d.Deadline)
|
|
.ToList();
|
|
}
|