Make piece-type testable by bitmask
[gnushogi.git] / gnushogi / init.c
index 1c034d0..ac870a5 100644 (file)
@@ -87,6 +87,20 @@ const small_short sweep[NO_PIECES] =
     false, true, true, false
 };
 
+const int typeMask[NO_PIECES] =
+{
+    0, T_PAWN,
+#ifndef MINISHOGI
+    T_LANCE, T_KNIGHT,
+#endif
+    T_SILVER, T_GOLD, T_BISHOP, T_ROOK,
+    T_PPAWN,
+#ifndef MINISHOGI
+    T_PLANCE, T_PKNIGHT,
+#endif
+    T_PSILVER, T_PBISHOP, T_PROOK, T_KING
+};
+
 
 #ifdef SAVE_DISTDATA
 short