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; } /// /// Returns the cell this piece will move to next. /// public Coords TargetCell => CurrentCell == StartCell ? EndCell : StartCell; }