gorrosion 0.1.3

Yet another Go/weiqi/igo/baduk/goe whatchamacallit
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use core::board::Board;

trait Rules<T: Board> {
	type Game;
	type Move;
	type Config;
	type Outcome;

	fn new(config: Self::Config) -> Self;
	fn legal_move(&self, game: &Self::Game, m: &Self::Move) -> bool;
	fn make_move(&self, game: &mut Self::Game, m: Self::Move);
	fn outcome(&self, game: &Self::Game) -> Option<Self::Outcome>;
	fn has_ended(&self, game: &Self::Game) -> bool {
		!self.outcome(game).is_none()
	}
}