ChessRule class

Rule validator 行棋规则

Constructors

ChessRule(ChessFen fen)
constructor of a validator
ChessRule.fromFen([String fenStr = ChessFen.initFen])
constructor of a validator

Properties

fen ChessFen
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

canParryKill(int team) bool
Can the deadlock be solved 是否可以解杀
getBeEatenList(int team) List<ChessItem>
获取要被吃的子,无根,或者吃子者权重低, 不含老将
getBeEatList(ChessPos pos) List<ChessItem>
获取被吃子的列表
getCheckEat(int team) List<String>
TODO 获取抽子招法 将军同时吃对方无根子 1.一个子将军,另一个子吃子,判断被吃子能否解将 2.躲将后是否有子被吃,被吃子能否解将
getCheckMate(int team, [int depth = 10]) List<String>
TODO 获取杀招 ,连将,连将过程中局面不会复原,不会被解将
getCheckMoves(int team) List<String>
获取某方所有的将军招法
getChessWeight(ChessPos pos) int
Weight of a chess (Experimental nature)
getEatList(ChessPos pos) List<ChessItem>
获取能吃的子的列表
isCheck(int team) bool
is checkmate 检查是否被将军
isCheckMate(int team) bool
is checkmate and deadlock 检查是否被将死
isKingMeet(int team) bool
is king meet 老将是否照面
isTrapped(int team) bool
is trapped 是否困毙
itemCanCheck(ChessPos pos, int team) bool
检查某个子是否能将军
movePoints(ChessPos activePos, [ChessPos? target]) List<String>
获取当前子力能移动的位置 target 为目标位置,如果传入了目标位置,则会优化检测
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
positionWeight(ChessPos pos) int
位置权重
rootCount(ChessPos pos, int team) int
获取某个位置的根数
teamCanCheck(int team) bool
whether the team team can do checkmate 检查方是否能将军
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

chessWeight → const Map<String, int>
棋子初始权重