[board] Implement KingMoveGenerator

Generate moves for kings.

This struct is trying out a different approach to iterators where the type
itself isn't one, but it has an iter() method that returns an iterator over all
the move lists.

This struct also builds all the moves up front, in new() before the new instance
is returned.
This commit is contained in:
Eryn Wells 2023-12-31 16:33:47 -08:00
parent af36b75df7
commit 4a54d8b877
4 changed files with 260 additions and 0 deletions

View file

@ -14,10 +14,18 @@ macro_rules! sq_constructor {
}
impl Square {
sq_constructor!(a1);
sq_constructor!(a2);
sq_constructor!(b1);
sq_constructor!(b2);
sq_constructor!(d3);
sq_constructor!(d4);
sq_constructor!(d5);
sq_constructor!(e2);
sq_constructor!(e3);
sq_constructor!(e4);
sq_constructor!(e5);
sq_constructor!(f3);
sq_constructor!(f4);
sq_constructor!(f5);
}