pub trait IsField {
    type Board: IsBoard<PieceWithSide = Self::PieceWithSide, Coord = Self::Coord>;
    type Coord: Eq + Debug;
    type PieceWithSide;
    type Side;

    fn move_nontam_piece_from_src_to_dest_while_taking_opponent_piece_if_needed(
        &self,
        from: Self::Coord,
        to: Self::Coord,
        whose_turn: Self::Side
    ) -> Result<Self, &'static str>
    where
        Self: Sized
; fn search_from_hop1zuo1_and_parachute_at(
        &self,
        color: Color,
        prof: Profession,
        side: Self::Side,
        dest: Self::Coord
    ) -> Option<Self>
    where
        Self: Sized
; fn as_board(&self) -> &Self::Board; fn as_board_mut(&mut self) -> &mut Self::Board; }
Expand description

A trait that signifies that you can use it as a FieldField として扱える型を表すトレイト

Required Associated Types§

A type that represents the board

A type that represents the coordinate

A type that represents the piece

A type that represents the side

Required Methods§

Moving a piece and taking it if necessary

Errors
  • from is unoccupied
  • from has Tam2
  • to has Tam2
  • from does not belong to whose_turn

Remove a specified piece from one’s hop1zuo1 and place it at dest; if none is found, or if dest is already occupied, return None. /手駒から指定の駒を削除し、盤面に置く。指定の駒が手駒に見当たらないか、dest が既に埋まっているなら None

Immutably borrows the board

Mutably borrows the board

Implementors§