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.
30 lines
896 B
C#
30 lines
896 B
C#
namespace Chessistics.Engine.Model;
|
|
|
|
public class PieceState
|
|
{
|
|
public int Id { get; }
|
|
public PieceKind Kind { get; }
|
|
public Coords StartCell { get; }
|
|
public Coords EndCell { get; }
|
|
public Coords CurrentCell { get; set; }
|
|
public CargoType? Cargo { get; set; }
|
|
public int SocialStatus { get; }
|
|
public int PlacementOrder { get; }
|
|
|
|
public PieceState(int id, PieceKind kind, Coords startCell, Coords endCell, int placementOrder)
|
|
{
|
|
Id = id;
|
|
Kind = kind;
|
|
StartCell = startCell;
|
|
EndCell = endCell;
|
|
CurrentCell = startCell;
|
|
Cargo = null;
|
|
SocialStatus = PieceRules.GetSocialStatus(kind);
|
|
PlacementOrder = placementOrder;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns the cell this piece will move to next.
|
|
/// </summary>
|
|
public Coords TargetCell => CurrentCell == StartCell ? EndCell : StartCell;
|
|
}
|