Rev 171 | Rev 177 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 171 | Rev 172 | ||
|---|---|---|---|
| Line 16... | Line 16... | ||
| 16 | // 1| R K B Q K B K R | - white |
16 | // 1| R K B Q K B K R | - white |
| 17 | // +-----------------+ |
17 | // +-----------------+ |
| 18 | // a b c d e f g h |
18 | // a b c d e f g h |
| 19 | 19 | ||
| 20 | 20 | ||
| 21 | bool Board_Init (board_t *board, int white_playertype, int black_playertype, wchar_t *fen_string) |
21 | bool Board_Init (board_t *board, int white_playertype, int black_playertype, wchar_t *game_rules, wchar_t *fen_string) |
| 22 | { |
22 | { |
| 23 | // this function initializes a new chess game |
23 | // this function initializes a new chess game |
| 24 | 24 | ||
| 25 | bool is_success; |
25 | bool is_success; |
| 26 | 26 | ||
| Line 42... | Line 42... | ||
| 42 | if (!is_success) |
42 | if (!is_success) |
| 43 | Move_SetupFromFEN (&board->moves[0], FENSTARTUP_STANDARDCHESS); // if so, fallback to standard chess table |
43 | Move_SetupFromFEN (&board->moves[0], FENSTARTUP_STANDARDCHESS); // if so, fallback to standard chess table |
| 44 | 44 | ||
| 45 | // reset all selection and hovering information |
45 | // reset all selection and hovering information |
| 46 | Board_SetSelectedAndHovered (board, -1, -1, -1, -1); |
46 | Board_SetSelectedAndHovered (board, -1, -1, -1, -1); |
| - | 47 | ||
| - | 48 | // set the game rules to the specified one |
|
| - | 49 | wcscpy_s (board->game_rules, WCHAR_SIZEOF (board->game_rules), game_rules); |
|
| 47 | 50 | ||
| 48 | // notify that board was just set up |
51 | // notify that board was just set up |
| 49 | board->was_setup = true; |
52 | board->was_setup = true; |
| 50 | board->players[COLOR_WHITE].should_wakeup = true; |
53 | board->players[COLOR_WHITE].should_wakeup = true; |
| 51 | board->players[COLOR_BLACK].should_wakeup = true; |
54 | board->players[COLOR_BLACK].should_wakeup = true; |