pub enum PureMove {
NonTamMoveSrcDst {
src: Coord,
dest: Coord,
is_water_entry_ciurl: bool,
},
NonTamMoveSrcStepDstFinite {
src: Coord,
step: Coord,
dest: Coord,
is_water_entry_ciurl: bool,
},
InfAfterStep {
src: Coord,
step: Coord,
planned_direction: Coord,
},
NonTamMoveFromHopZuo {
color: Color,
prof: Profession,
dest: Coord,
},
TamMoveNoStep {
src: Coord,
first_dest: Coord,
second_dest: Coord,
},
TamMoveStepsDuringFormer {
src: Coord,
step: Coord,
first_dest: Coord,
second_dest: Coord,
},
TamMoveStepsDuringLatter {
src: Coord,
step: Coord,
first_dest: Coord,
second_dest: Coord,
},
}
Expand description
Describes a move denoted in absolute coordinates. /絶対座標で書かれた指し手を表す。
Variants§
NonTamMoveSrcDst
Fields
A non-Tam2 piece moves from a square on a board to another square without stepping. /皇ではない駒が、盤上から盤上に踏越えなしで移動する。
NonTamMoveSrcStepDstFinite
Fields
A non-Tam2 piece moves from a square on a board to another square, during which it steps another piece and does a finite movement. /皇ではない駒が、盤上から盤上に踏越えを伴いながら移動し、踏越え後は有限移動をする。
InfAfterStep
Fields
A non-Tam2 piece moves from a square on a board to another square, during which it steps another piece and tries to do a directional, infinite movement. /皇ではない駒が、盤上から盤上に踏越えを伴いながら移動し、踏越え後は無限移動をしようとする。
NonTamMoveFromHopZuo
A non-Tam2 piece moves from hop1zuo1 to a square on a board. /皇ではない駒が、手駒から盤上に移動する。
TamMoveNoStep
Fields
A Tam2 moves from a square on a board to another square without stepping. /皇が盤上から盤上に踏越えなしで移動する。
TamMoveStepsDuringFormer
Fields
A Tam2 moves from a square on a board to another square. In the former half of its movement, it steps another piece. /皇が盤上から盤上に移動し、一回目の移動の最中に踏越えをする。
TamMoveStepsDuringLatter
Fields
A Tam2 moves from a square on a board to another square. In the latter half of its movement, it steps another piece. /皇が盤上から盤上に移動し、二回目の移動の最中に踏越えをする。
Implementations§
source§impl PureMove
impl PureMove
sourcepub fn serialize(self) -> String
pub fn serialize(self) -> String
Serializes PureMove
in textual form.
Examples
use cetkaik_core::*;
use cetkaik_core::absolute::*;
assert_eq!(PureMove::InfAfterStep {
src: Coord(Row::A, Column::Z),
step: Coord(Row::E, Column::T),
planned_direction: Coord(Row::E, Column::N)
}.serialize(), "ZA片TE心NE");
assert_eq!(PureMove::NonTamMoveFromHopZuo {
color: Color::Huok2,
prof: Profession::Gua2,
dest: Coord(Row::IA, Column::L)
}.serialize(), "黒弓LIA");
assert_eq!(PureMove::NonTamMoveSrcDst {
src: Coord(Row::A, Column::Z),
dest: Coord(Row::E, Column::N),
is_water_entry_ciurl: true
}.serialize(), "ZA片NE水");
assert_eq!(PureMove::NonTamMoveSrcStepDstFinite {
src: Coord(Row::A, Column::Z),
step: Coord(Row::E, Column::T),
dest: Coord(Row::E, Column::N),
is_water_entry_ciurl: false
}.serialize(), "ZA片TENE");
// Note that [] denotes the first destination.
// Since the first destination is neither the stepping square nor the final square,
// it is not to be written in the standard notation.
// Hence this additional information is denoted by [].
assert_eq!(PureMove::TamMoveStepsDuringFormer {
src: Coord(Row::E, Column::K),
step: Coord(Row::I, Column::L),
first_dest: Coord(Row::I, Column::K),
second_dest: Coord(Row::E, Column::L)
}.serialize(), "KE皇LI[KI]LE");
assert_eq!(PureMove::TamMoveNoStep {
src: Coord(Row::E, Column::K),
first_dest: Coord(Row::I, Column::K),
second_dest: Coord(Row::E, Column::K)
}.serialize(), "KE皇[KI]KE");
assert_eq!(PureMove::TamMoveStepsDuringLatter {
src: Coord(Row::E, Column::K),
first_dest: Coord(Row::I, Column::K),
step: Coord(Row::I, Column::L),
second_dest: Coord(Row::E, Column::L)
}.serialize(), "KE皇[KI]LILE");