public class Move extends Object implements Comparable<Move>
Modifier and Type | Field and Description |
---|---|
byte |
capturedPiece |
byte |
from |
byte |
movedPiece |
static Move |
NULL_MOVE
A null move instance.
|
byte |
to |
byte |
type |
Constructor and Description |
---|
Move()
Default constructor.
|
Move(byte from,
byte to,
byte movedPiece,
byte capturedPiece,
byte type) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Move m) |
boolean |
equals(int m)
Returns whether this move is equal to the move that is encoded into the integer parameter.
|
boolean |
equals(Move m)
Returns whether this move is equal to the input parameter move.
|
boolean |
equals(Object o) |
short |
getValue() |
int |
hashCode() |
boolean |
isTactical()
Returns whether the move is a tactical move or not.
|
void |
setValue(short value) |
int |
toInt()
Encodes the state of the instance (except the score) into a 4 byte integer.
|
static Move |
toMove(int move)
Parses a move encoded in a 32 bitboard integer.
|
String |
toString() |
public static final Move NULL_MOVE
public final byte from
public final byte to
public final byte movedPiece
public final byte capturedPiece
public final byte type
public Move()
public Move(byte from, byte to, byte movedPiece, byte capturedPiece, byte type)
from
- The index of the origin square.to
- The index of the destination square.movedPiece
- The numeric notation of the type of the moved piece.capturedPiece
- The numeric notation of the type of the captured piece.type
- The type of the move.public static Move toMove(int move)
move
- The encoded move.public short getValue()
public void setValue(short value)
value
- The value assigned to the move (for whatever purpose).public int toInt()
public boolean isTactical()
public boolean equals(Move m)
m
- The move to compare to.public boolean equals(int m)
m
- The move to compare to encoded as an integer.public int compareTo(Move m) throws NullPointerException
compareTo
in interface Comparable<Move>
NullPointerException
Copyright © 2020. All rights reserved.