16 lines
906 B
C#
16 lines
906 B
C#
namespace Shogi.Domain.Other;
|
|
|
|
public interface IRulesLifecycle<TPiece> where TPiece : IRulesLifecycle<TPiece>
|
|
{
|
|
/// <summary>
|
|
/// Invoked by <see cref="BoardRules{TPiece}.ValidateMove(Vector2, Vector2, bool)"/> during the MoveValidation life cycle event.
|
|
/// If a move begins or ends outside the board space coordinates, this function is not called.
|
|
/// The purpose is to ensure a proposed board move is valid with regard to the moved piece's rules.
|
|
/// This event does not worry about check or check-mate, or if a move is legal.
|
|
///
|
|
/// </summary>
|
|
/// <param name="context">A context object with information for you to use to assess whether a move is valid for your implementing piece.</param>
|
|
/// <returns>A new <see cref="RulesLifecycleResult"/> object indicating whether or not the move is valid.</returns>
|
|
RulesLifecycleResult OnMoveValidation(MoveValidationContext<TPiece> context);
|
|
}
|