Esempio n. 1
0
        protected override unsafe void OnMouseClick(MouseEventArgs e)
        {
            try
            {
                int x = (e.X / TileSize);
                int y = 7 - (e.Y / TileSize);

                int index = x + y * 8;

                if (index == SelectedTile)
                {
                    SelectedTile = -1;
                }
                else
                {
                    SelectedTile = index;
                }

                if (SelectedTile != -1 && State[SelectedTile] > 0)
                {
                    Move *moveList = stackalloc Move[100];
                    ulong moves    = Moves.GetMoves((BoardStruct *)BoardStruct, SelectedTile);
                    MoveArray = Bitboard.Bitboard_BitList(moves).Select(n => (int)n).ToArray();
                }
                else
                {
                    MoveArray = new int[0];
                }

                RefreshBuffer();
            }
            catch (Exception) { }
        }
Esempio n. 2
0
 public static unsafe extern int GetAllMoves(BoardStruct *board, Move *moveList100);