pub struct TicTacToeState<B: Backend> {
pub current_player: I32<B>,
pub legal_action_mask: Array<B, bool>,
pub step_count: I32<B>,
pub color: I32<B>,
pub board: Array<B, i32>,
pub winner: I32<B>,
}Expand description
The state of a game of tic-tac-toe: Pgx’s State without the
observation and the rewards (which step returns), in the order of its
leaves.
Fields§
§current_player: I32<B>The player to move (0 or 1).
legal_action_mask: Array<B, bool>The empty cells (bool[9]; all ones after the game ended).
step_count: I32<B>Steps taken in the game.
color: I32<B>The mark to place: 0 (X) or 1 (O).
board: Array<B, i32>The cells in row-major order (i32[9]): -1 empty, 0 X, 1 O.
winner: I32<B>The mark that won, or -1.
Trait Implementations§
Source§impl<B: Backend> Tree<B> for TicTacToeState<B>
impl<B: Backend> Tree<B> for TicTacToeState<B>
Source§type On<__RuxlaC: Backend> = TicTacToeState<__RuxlaC>
type On<__RuxlaC: Backend> = TicTacToeState<__RuxlaC>
The same structure on backend
C.Source§fn unflatten_like(
&self,
leaves: &mut dyn Iterator<Item = <B as Backend>::Leaf>,
) -> Self
fn unflatten_like( &self, leaves: &mut dyn Iterator<Item = <B as Backend>::Leaf>, ) -> Self
Builds a value of the same structure from leaves.
Auto Trait Implementations§
impl<B> Freeze for TicTacToeState<B>
impl<B> RefUnwindSafe for TicTacToeState<B>where
<B as Backend>::Scalar<i32>: RefUnwindSafe,
<B as Backend>::Array<bool>: RefUnwindSafe,
<B as Backend>::Array<i32>: RefUnwindSafe,
impl<B> Send for TicTacToeState<B>
impl<B> Sync for TicTacToeState<B>
impl<B> Unpin for TicTacToeState<B>
impl<B> UnsafeUnpin for TicTacToeState<B>where
<B as Backend>::Scalar<i32>: UnsafeUnpin,
<B as Backend>::Array<bool>: UnsafeUnpin,
<B as Backend>::Array<i32>: UnsafeUnpin,
impl<B> UnwindSafe for TicTacToeState<B>where
<B as Backend>::Scalar<i32>: UnwindSafe,
<B as Backend>::Array<bool>: UnwindSafe,
<B as Backend>::Array<i32>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more