ChessFen class
A snapshot of game
Constructors
- ChessFen.new([String fenStr = initFen])
- Constructor by a fenstr
Properties
-
deductions
→ List<
ChessFen> -
推演变化
final
- fen ↔ String
-
get current fenstr
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearFen(
) → void - force refresh fenstr(usually after batch of moves)
-
copy(
) → ChessFen - A copy of current situation
-
find(
String matchCode) → ChessPos? - Find a chess by a type code
-
findAll(
String matchCode) → List< ChessPos> - Find all chess of a type code
-
findByCol(
int col, [int? min, int? max]) → List< ChessItem> - Find item in a col
-
getAll(
) → List< ChessItem> - Get all valid items of this situation
-
getAllChr(
) → String - Get all valid item code
-
getDieChr(
) → String - Get item is dead
-
hasItemAt(
ChessPos pos, {int team = -1}) → bool - Whether there is a valid item at pos
-
itemAt(
String pos) → String - Get piece at the string position code
-
itemAtPos(
ChessPos pos) → String - Get item from a ChessPos
-
move(
String move) → bool - Move then change the game situation
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
position(
) → ChessFen - 创建当前局面下的子力位置
-
posSort(
ChessPos key1, ChessPos key2) → int - Sort pos
-
toChineseString(
String move) → String - Translate a move to chinese
-
toChineseTree(
List< String> moves) → List<String> - A list of moves to chinese
-
toPositionString(
int team, String move) → String - Translate a move to positional representation
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
int key) → ChessFenRow - Get row
-
operator []=(
int key, ChessFenRow value) → void - Set row
Static Methods
-
getChineseResult(
String result) → String - Result of chinese
Constants
-
colBlack
→ const List<
String> - black codes
- colIndexBase → const int
- for col index
-
colRed
→ const List<
String> - col name of red team
- emptyFen → const String
- Initialize chess layout
- initFen → const String
- Initialize chess layout
-
nameBlackMap
→ const Map<
String, String> - map black code to chinese
-
nameMap
→ const Map<
String, String> - map chinese chess to code
-
nameRedMap
→ const Map<
String, String> - map red code to chinese
-
replaceNumber
→ const List<
String> - chinese numbers