Class Move
Represents a game move.
Inheritance
Inherited Members
Namespace: ChessSharp
Assembly: ChessSharp.dll
Syntax
public class Move
Constructors
| Improve this Doc View SourceMove(Square, Square, Player, Nullable<PawnPromotion>)
Initializes a new instance of the Move class with the given arguments.
Declaration
public Move(Square source, Square destination, Player player, PawnPromotion? promoteTo = default(PawnPromotion? ))
Parameters
Type | Name | Description |
---|---|---|
Square | source | |
Square | destination | |
Player | player | |
System.Nullable<PawnPromotion> | promoteTo | Optional nullable PawnPromotion of the Move. Default value is null. |
Properties
| Improve this Doc View SourceDestination
Declaration
public Square Destination { get; }
Property Value
Type | Description |
---|---|
Square |
Player
Declaration
public Player Player { get; }
Property Value
Type | Description |
---|---|
Player |
PromoteTo
Gets a nullable PawnPromotion of the Move.
Declaration
public PawnPromotion? PromoteTo { get; }
Property Value
Type | Description |
---|---|
System.Nullable<PawnPromotion> |
Source
Declaration
public Square Source { get; }
Property Value
Type | Description |
---|---|
Square |
Methods
| Improve this Doc View SourceEquals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
GetAbsDeltaX()
Gets the absolute value of the subtraction of the source file and the destination file.
Declaration
public int GetAbsDeltaX()
Returns
Type | Description |
---|---|
System.Int32 | Returns an integer that is the subtraction of the source file and the destination file. |
GetAbsDeltaY()
Gets the absolute value of the subtraction of the source rank and the destination rank.
Declaration
public int GetAbsDeltaY()
Returns
Type | Description |
---|---|
System.Int32 | Returns an integer that is the subtraction of the source rank and the destination rank. |
GetDeltaX()
Gets the subtraction of the source file from the destination file.
Declaration
public int GetDeltaX()
Returns
Type | Description |
---|---|
System.Int32 | Returns an integer that is the subtraction of the source file from the destination file. |
GetDeltaY()
Gets the subtraction of the source rank from the destination rank.
Declaration
public int GetDeltaY()
Returns
Type | Description |
---|---|
System.Int32 | Returns an integer that is the subtraction of the source rank from the destination rank. |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |