1 /***************************************************************************
2 move.h - Move related definitions
4 begin : Sun Nov 28 2007
5 copyright : (C) 2007 by Maurizio Monge
6 email : monge@linuz.sns.it
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
23 // store all the possible moves of a knight.
24 class PACKED KnightMove
32 /* PACKED, use a small structure even if unaligned.
33 if i can quote Alan Cox, "Cache is king" :) */
41 uint8_t from
; /* square we are moving from */
42 uint8_t to
; /* square we are moving to */
52 int operator==(const Move
& m
){
53 return (as_int
== m
.as_int
); }
54 int operator!=(const Move
& m
) {
55 return (as_int
!= m
.as_int
); }
57 static Move
FromInt(int i
)
66 m
.as_int
= 0xfffffffe;
72 m
.as_int
= 0xffffffff;