othello_agent/gameplay/
types.rs1pub type IBoard = [[IPiece; 8]; 8];
2
3pub type IPiece = u8;
5
6pub type IPlayer = u8;
7
8#[allow(dead_code)]
9pub struct IGameAttrs {
10 pub board_str: String,
11 pub last_piece_str: String,
12 pub turn_str: String,
13}
14
15#[allow(dead_code)]
16pub struct IPosition {
17 pub rightwards: i8,
19 pub downwards: i8,
20}
21
22impl IPosition {
23 pub fn add(&mut self, other: IPosition) {
25 self.rightwards += other.rightwards;
26 self.downwards += other.downwards;
27 }
28
29 pub fn duplicate(&self) -> IPosition {
31 IPosition {
32 rightwards: self.rightwards,
33 downwards: self.downwards,
34 }
35 }
36}
37
38pub type IPositionOption = Option<IPosition>;