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,
},
}
Variants§
NonTamMoveSrcDst
NonTamMoveSrcStepDstFinite
InfAfterStep
NonTamMoveFromHopZuo
TamMoveNoStep
TamMoveStepsDuringFormer
TamMoveStepsDuringLatter
Implementations§
source§impl PureMove
impl PureMove
sourcepub fn serialize(self) -> String
pub fn serialize(self) -> String
Serializes PureMove
in textual form.
Examples
use cetkaik_yhuap_move_candidates::*;
use cetkaik_yhuap_move_candidates::pure_move::*;
use cetkaik_core::*;
assert_eq!(PureMove::InfAfterStep {
src: absolute::Coord(absolute::Row::A, absolute::Column::Z),
step: absolute::Coord(absolute::Row::E, absolute::Column::T),
planned_direction: absolute::Coord(absolute::Row::E, absolute::Column::N)
}.serialize(), "ZA片TE心NE");
assert_eq!(PureMove::NonTamMoveFromHopZuo {
color: Color::Huok2,
prof: Profession::Gua2,
dest: absolute::Coord(absolute::Row::IA, absolute::Column::L)
}.serialize(), "黒弓LIA");
assert_eq!(PureMove::NonTamMoveSrcDst {
src: absolute::Coord(absolute::Row::A, absolute::Column::Z),
dest: absolute::Coord(absolute::Row::E, absolute::Column::N),
is_water_entry_ciurl: true
}.serialize(), "ZA片NE水");
assert_eq!(PureMove::NonTamMoveSrcStepDstFinite {
src: absolute::Coord(absolute::Row::A, absolute::Column::Z),
step: absolute::Coord(absolute::Row::E, absolute::Column::T),
dest: absolute::Coord(absolute::Row::E, absolute::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: absolute::Coord(absolute::Row::E, absolute::Column::K),
step: absolute::Coord(absolute::Row::I, absolute::Column::L),
first_dest: absolute::Coord(absolute::Row::I, absolute::Column::K),
second_dest: absolute::Coord(absolute::Row::E, absolute::Column::L)
}.serialize(), "KE皇LI[KI]LE");
assert_eq!(PureMove::TamMoveNoStep {
src: absolute::Coord(absolute::Row::E, absolute::Column::K),
first_dest: absolute::Coord(absolute::Row::I, absolute::Column::K),
second_dest: absolute::Coord(absolute::Row::E, absolute::Column::K)
}.serialize(), "KE皇[KI]KE");
assert_eq!(PureMove::TamMoveStepsDuringLatter {
src: absolute::Coord(absolute::Row::E, absolute::Column::K),
first_dest: absolute::Coord(absolute::Row::I, absolute::Column::K),
step: absolute::Coord(absolute::Row::I, absolute::Column::L),
second_dest: absolute::Coord(absolute::Row::E, absolute::Column::L)
}.serialize(), "KE皇[KI]LILE");