1580
1596
self->players[COLOR_BLACK] = _tmp2_;
1581
1597
_tmp3_ = self->players[COLOR_BLACK];
1602
gboolean _tmp4_ = FALSE;
1607
ChessPiece* _tmp8_ = NULL;
1599
1613
_tmp4_ = FALSE;
1615
if (!(_tmp6_ < 64)) {
1601
if (!(_tmp7_ < 64)) {
1605
_chess_piece_unref0 (self->board[_tmp8_]);
1606
self->board[_tmp8_] = NULL;
1607
_tmp9_ = self->board[_tmp8_];
1619
_chess_piece_unref0 (self->board[_tmp7_]);
1620
self->board[_tmp7_] = NULL;
1621
_tmp8_ = self->board[_tmp7_];
1612
_tmp12_ = _tmp11_ = g_strsplit (_tmp10_, " ", 0);
1614
fields_length1 = _vala_array_length (_tmp11_);
1626
_tmp11_ = _tmp10_ = g_strsplit (_tmp9_, " ", 0);
1628
fields_length1 = _vala_array_length (_tmp10_);
1615
1629
_fields_size_ = fields_length1;
1617
_tmp13__length1 = fields_length1;
1618
_tmp14_ = _tmp13_[0];
1619
_tmp16_ = _tmp15_ = g_strsplit (_tmp14_, "/", 0);
1621
ranks_length1 = _vala_array_length (_tmp15_);
1631
_tmp12__length1 = fields_length1;
1632
_tmp13_ = _tmp12_[0];
1633
_tmp15_ = _tmp14_ = g_strsplit (_tmp13_, "/", 0);
1635
ranks_length1 = _vala_array_length (_tmp14_);
1622
1636
_ranks_size_ = ranks_length1;
1641
gboolean _tmp16_ = FALSE;
1633
gint _tmp21__length1;
1635
const gchar* _tmp23_;
1645
gchar* rank_string = NULL;
1646
gchar** _tmp19_ = NULL;
1647
gint _tmp19__length1 = 0;
1649
const gchar* _tmp21_ = NULL;
1650
gchar* _tmp22_ = NULL;
1658
if (!(_tmp18_ < 8)) {
1662
_tmp19__length1 = ranks_length1;
1645
1663
_tmp20_ = rank;
1646
if (!(_tmp20_ < 8)) {
1650
_tmp21__length1 = ranks_length1;
1652
_tmp23_ = _tmp21_[7 - _tmp22_];
1653
_tmp24_ = g_strdup (_tmp23_);
1654
rank_string = _tmp24_;
1664
_tmp21_ = _tmp19_[7 - _tmp20_];
1665
_tmp22_ = g_strdup (_tmp21_);
1666
rank_string = _tmp22_;
1673
gboolean _tmp23_ = FALSE;
1665
gboolean _tmp28_ = FALSE;
1668
const gchar* _tmp35_;
1670
gchar _tmp37_ = '\0';
1672
gboolean _tmp38_ = FALSE;
1676
gboolean _tmp25_ = FALSE;
1679
const gchar* _tmp31_ = NULL;
1681
gchar _tmp33_ = '\0';
1682
gboolean _tmp34_ = FALSE;
1683
gchar _tmp35_ = '\0';
1675
1684
PieceType type = 0;
1678
gboolean _tmp46_ = FALSE;
1682
gchar _tmp49_ = '\0';
1683
PieceType _tmp50_ = 0;
1684
gboolean _tmp51_ = FALSE;
1690
ChessPlayer* _tmp56_;
1692
ChessPiece* _tmp58_;
1695
ChessPiece* _tmp60_;
1696
ChessPiece* _tmp61_;
1697
ChessPiece* _tmp62_;
1686
gchar _tmp40_ = '\0';
1687
gboolean _tmp41_ = FALSE;
1689
gchar _tmp42_ = '\0';
1690
gchar _tmp43_ = '\0';
1691
PieceType _tmp44_ = 0;
1692
gboolean _tmp45_ = FALSE;
1697
ChessPiece* piece = NULL;
1699
ChessPlayer* _tmp50_ = NULL;
1700
PieceType _tmp51_ = 0;
1701
ChessPiece* _tmp52_ = NULL;
1703
ChessPiece* _tmp54_ = NULL;
1704
ChessPiece* _tmp55_ = NULL;
1705
ChessPiece* _tmp56_ = NULL;
1708
gint64 _tmp58_ = 0LL;
1710
gint64 _tmp60_ = 0LL;
1711
gint64 _tmp61_ = 0LL;
1716
offset = _tmp24_ + 1;
1722
const gchar* _tmp28_ = NULL;
1708
1725
_tmp27_ = offset;
1709
offset = _tmp27_ + 1;
1715
const gchar* _tmp31_;
1719
_tmp31_ = rank_string;
1720
_tmp32_ = strlen (_tmp31_);
1722
_tmp28_ = _tmp30_ < _tmp33_;
1726
_tmp28_ = rank_string;
1727
_tmp29_ = strlen (_tmp28_);
1729
_tmp25_ = _tmp27_ < _tmp30_;
1730
_tmp35_ = rank_string;
1732
_tmp37_ = string_get (_tmp35_, (glong) _tmp36_);
1735
if (_tmp39_ >= '1') {
1738
_tmp38_ = _tmp40_ <= '8';
1736
_tmp31_ = rank_string;
1738
_tmp33_ = string_get (_tmp31_, (glong) _tmp32_);
1741
if (_tmp35_ >= '1') {
1742
gchar _tmp36_ = '\0';
1744
_tmp34_ = _tmp36_ <= '8';
1750
gchar _tmp38_ = '\0';
1753
file = _tmp37_ + (_tmp38_ - '0');
1757
_tmp41_ = g_ascii_isupper (_tmp40_);
1748
file = _tmp42_ + (_tmp43_ - '0');
1752
_tmp46_ = g_ascii_isupper (_tmp45_);
1754
_tmp44_ = COLOR_WHITE;
1759
_tmp39_ = COLOR_WHITE;
1756
_tmp44_ = COLOR_BLACK;
1761
_tmp49_ = g_ascii_toupper (_tmp48_);
1762
_tmp51_ = chess_state_decode_piece_type (self, (gunichar) _tmp49_, &_tmp50_);
1768
_tmp54_ = chess_state_get_index (self, _tmp52_, _tmp53_);
1771
_tmp56_ = self->players[_tmp55_];
1773
_tmp58_ = chess_piece_new (_tmp56_, _tmp57_);
1777
_tmp61_ = _chess_piece_ref0 (_tmp60_);
1778
_chess_piece_unref0 (self->board[_tmp59_]);
1779
self->board[_tmp59_] = _tmp61_;
1780
_tmp62_ = self->board[_tmp59_];
1782
_tmp64_ = BIT_BOARD_set_location_masks[_tmp63_];
1786
self->priv->piece_masks[_tmp65_] |= _tmp66_;
1787
_tmp67_ = self->priv->piece_masks[_tmp65_];
1761
_tmp39_ = COLOR_BLACK;
1765
_tmp43_ = g_ascii_toupper (_tmp42_);
1766
_tmp45_ = chess_state_decode_piece_type (self, (gunichar) _tmp43_, &_tmp44_);
1772
_tmp48_ = chess_state_get_index (self, _tmp46_, _tmp47_);
1775
_tmp50_ = self->players[_tmp49_];
1777
_tmp52_ = chess_piece_new (_tmp50_, _tmp51_);
1781
_tmp55_ = _chess_piece_ref0 (_tmp54_);
1782
_chess_piece_unref0 (self->board[_tmp53_]);
1783
self->board[_tmp53_] = _tmp55_;
1784
_tmp56_ = self->board[_tmp53_];
1786
_tmp58_ = BIT_BOARD_set_location_masks[_tmp57_];
1790
self->priv->piece_masks[_tmp59_] |= _tmp60_;
1791
_tmp61_ = self->priv->piece_masks[_tmp59_];
1790
1794
_chess_piece_unref0 (piece);
2112
2117
gboolean _tmp4_ = FALSE;
2113
2118
gboolean _tmp5_ = FALSE;
2114
2119
gboolean _tmp6_ = FALSE;
2115
gboolean _tmp7_ = FALSE;
2116
gboolean _tmp8_ = FALSE;
2117
gboolean _tmp9_ = FALSE;
2118
gboolean _tmp10_ = FALSE;
2119
gboolean _tmp11_ = FALSE;
2121
ChessState* _tmp13_;
2120
gint64 _tmp7_ = 0LL;
2121
ChessState* _tmp8_ = NULL;
2122
gint64 _tmp9_ = 0LL;
2135
2123
g_return_val_if_fail (self != NULL, FALSE);
2136
2124
g_return_val_if_fail (state != NULL, FALSE);
2137
_tmp12_ = self->priv->piece_masks[COLOR_WHITE];
2139
_tmp14_ = _tmp13_->priv->piece_masks[COLOR_WHITE];
2140
if (_tmp12_ != _tmp14_) {
2144
ChessState* _tmp16_;
2146
_tmp15_ = self->priv->piece_masks[COLOR_BLACK];
2148
_tmp17_ = _tmp16_->priv->piece_masks[COLOR_BLACK];
2149
_tmp11_ = _tmp15_ != _tmp17_;
2156
ChessState* _tmp20_;
2158
_tmp19_ = self->can_castle_kingside[COLOR_WHITE];
2160
_tmp21_ = _tmp20_->can_castle_kingside[COLOR_WHITE];
2161
_tmp10_ = _tmp19_ != _tmp21_;
2168
ChessState* _tmp24_;
2170
_tmp23_ = self->can_castle_queenside[COLOR_WHITE];
2172
_tmp25_ = _tmp24_->can_castle_queenside[COLOR_WHITE];
2173
_tmp9_ = _tmp23_ != _tmp25_;
2180
ChessState* _tmp28_;
2182
_tmp27_ = self->can_castle_kingside[COLOR_BLACK];
2184
_tmp29_ = _tmp28_->can_castle_kingside[COLOR_BLACK];
2185
_tmp8_ = _tmp27_ != _tmp29_;
2192
ChessState* _tmp32_;
2194
_tmp31_ = self->can_castle_queenside[COLOR_BLACK];
2196
_tmp33_ = _tmp32_->can_castle_queenside[COLOR_BLACK];
2197
_tmp7_ = _tmp31_ != _tmp33_;
2125
_tmp7_ = self->priv->piece_masks[COLOR_WHITE];
2127
_tmp9_ = _tmp8_->priv->piece_masks[COLOR_WHITE];
2128
if (_tmp7_ != _tmp9_) {
2204
ChessState* _tmp36_;
2206
_tmp35_ = self->en_passant_index;
2208
_tmp37_ = _tmp36_->en_passant_index;
2209
_tmp6_ = _tmp35_ != _tmp37_;
2131
gint64 _tmp10_ = 0LL;
2132
ChessState* _tmp11_ = NULL;
2133
gint64 _tmp12_ = 0LL;
2134
_tmp10_ = self->priv->piece_masks[COLOR_BLACK];
2136
_tmp12_ = _tmp11_->priv->piece_masks[COLOR_BLACK];
2137
_tmp6_ = _tmp10_ != _tmp12_;
2216
ChessState* _tmp40_;
2218
_tmp39_ = self->last_move;
2220
_tmp41_ = _tmp40_->last_move;
2221
_tmp5_ = (_tmp39_ != NULL) != (_tmp41_ != NULL);
2142
ChessPlayer* _tmp13_ = NULL;
2144
ChessState* _tmp15_ = NULL;
2145
ChessPlayer* _tmp16_ = NULL;
2147
_tmp13_ = self->current_player;
2148
_tmp14_ = _tmp13_->color;
2150
_tmp16_ = _tmp15_->current_player;
2151
_tmp17_ = _tmp16_->color;
2152
_tmp5_ = _tmp14_ != _tmp17_;
2228
ChessPiece* _tmp44_;
2230
ChessState* _tmp46_;
2232
ChessPiece* _tmp48_;
2234
_tmp43_ = self->last_move;
2235
_tmp44_ = _tmp43_->piece;
2236
_tmp45_ = _tmp44_->type;
2238
_tmp47_ = _tmp46_->last_move;
2239
_tmp48_ = _tmp47_->piece;
2240
_tmp49_ = _tmp48_->type;
2241
_tmp4_ = _tmp45_ != _tmp49_;
2157
gboolean _tmp18_ = FALSE;
2158
ChessState* _tmp19_ = NULL;
2159
gboolean _tmp20_ = FALSE;
2160
_tmp18_ = self->can_castle_kingside[COLOR_WHITE];
2162
_tmp20_ = _tmp19_->can_castle_kingside[COLOR_WHITE];
2163
_tmp4_ = _tmp18_ != _tmp20_;
2249
ChessState* _tmp53_;
2252
_tmp51_ = self->last_move;
2253
_tmp52_ = _tmp51_->r0;
2255
_tmp54_ = _tmp53_->last_move;
2256
_tmp55_ = _tmp54_->r0;
2257
_tmp3_ = _tmp52_ != _tmp55_;
2168
gboolean _tmp21_ = FALSE;
2169
ChessState* _tmp22_ = NULL;
2170
gboolean _tmp23_ = FALSE;
2171
_tmp21_ = self->can_castle_queenside[COLOR_WHITE];
2173
_tmp23_ = _tmp22_->can_castle_queenside[COLOR_WHITE];
2174
_tmp3_ = _tmp21_ != _tmp23_;
2265
ChessState* _tmp59_;
2268
_tmp57_ = self->last_move;
2269
_tmp58_ = _tmp57_->f0;
2271
_tmp60_ = _tmp59_->last_move;
2272
_tmp61_ = _tmp60_->f0;
2273
_tmp2_ = _tmp58_ != _tmp61_;
2179
gboolean _tmp24_ = FALSE;
2180
ChessState* _tmp25_ = NULL;
2181
gboolean _tmp26_ = FALSE;
2182
_tmp24_ = self->can_castle_kingside[COLOR_BLACK];
2184
_tmp26_ = _tmp25_->can_castle_kingside[COLOR_BLACK];
2185
_tmp2_ = _tmp24_ != _tmp26_;
2281
ChessState* _tmp65_;
2284
_tmp63_ = self->last_move;
2285
_tmp64_ = _tmp63_->r1;
2287
_tmp66_ = _tmp65_->last_move;
2288
_tmp67_ = _tmp66_->r1;
2289
_tmp1_ = _tmp64_ != _tmp67_;
2190
gboolean _tmp27_ = FALSE;
2191
ChessState* _tmp28_ = NULL;
2192
gboolean _tmp29_ = FALSE;
2193
_tmp27_ = self->can_castle_queenside[COLOR_BLACK];
2195
_tmp29_ = _tmp28_->can_castle_queenside[COLOR_BLACK];
2196
_tmp1_ = _tmp27_ != _tmp29_;
2297
ChessState* _tmp71_;
2300
_tmp69_ = self->last_move;
2301
_tmp70_ = _tmp69_->f1;
2303
_tmp72_ = _tmp71_->last_move;
2304
_tmp73_ = _tmp72_->f1;
2305
_tmp0_ = _tmp70_ != _tmp73_;
2202
ChessState* _tmp31_ = NULL;
2204
_tmp30_ = self->en_passant_index;
2206
_tmp32_ = _tmp31_->en_passant_index;
2207
_tmp0_ = _tmp30_ != _tmp32_;
2309
2210
result = FALSE;
2217
gboolean _tmp33_ = FALSE;
2321
gboolean _tmp79_ = FALSE;
2323
ChessPiece* _tmp81_;
2221
gboolean _tmp36_ = FALSE;
2223
ChessPiece* _tmp38_ = NULL;
2333
if (!(_tmp78_ < 64)) {
2231
if (!(_tmp35_ < 64)) {
2337
_tmp81_ = self->board[_tmp80_];
2338
if (_tmp81_ != NULL) {
2340
ChessPiece* _tmp83_;
2342
ChessState* _tmp85_;
2344
ChessPiece* _tmp87_;
2347
_tmp83_ = self->board[_tmp82_];
2348
_tmp84_ = _tmp83_->type;
2351
_tmp87_ = _tmp85_->board[_tmp86_];
2352
_tmp88_ = _tmp87_->type;
2353
_tmp79_ = _tmp84_ != _tmp88_;
2235
_tmp38_ = self->board[_tmp37_];
2236
if (_tmp38_ != NULL) {
2238
ChessPiece* _tmp40_ = NULL;
2239
PieceType _tmp41_ = 0;
2240
ChessState* _tmp42_ = NULL;
2242
ChessPiece* _tmp44_ = NULL;
2243
PieceType _tmp45_ = 0;
2245
_tmp40_ = self->board[_tmp39_];
2246
_tmp41_ = _tmp40_->type;
2249
_tmp44_ = _tmp42_->board[_tmp43_];
2250
_tmp45_ = _tmp44_->type;
2251
_tmp36_ = _tmp41_ != _tmp45_;
2359
2256
result = FALSE;
2370
2267
gchar* chess_state_get_fen (ChessState* self) {
2371
2268
gchar* result = NULL;
2375
ChessPlayer* _tmp29_;
2392
ChessPlayer* _tmp59_;
2395
const gchar* _tmp66_;
2269
GString* value = NULL;
2270
GString* _tmp0_ = NULL;
2271
GString* _tmp26_ = NULL;
2272
ChessPlayer* _tmp27_ = NULL;
2274
GString* _tmp31_ = NULL;
2275
gboolean _tmp32_ = FALSE;
2276
gboolean _tmp34_ = FALSE;
2277
gboolean _tmp36_ = FALSE;
2278
gboolean _tmp38_ = FALSE;
2279
gboolean _tmp40_ = FALSE;
2280
gboolean _tmp41_ = FALSE;
2281
gboolean _tmp42_ = FALSE;
2282
gboolean _tmp43_ = FALSE;
2283
GString* _tmp45_ = NULL;
2285
GString* _tmp53_ = NULL;
2286
GString* _tmp54_ = NULL;
2288
GString* _tmp56_ = NULL;
2289
ChessPlayer* _tmp57_ = NULL;
2291
GString* _tmp63_ = NULL;
2292
const gchar* _tmp64_ = NULL;
2293
gchar* _tmp65_ = NULL;
2397
2294
g_return_val_if_fail (self != NULL, NULL);
2398
2295
_tmp0_ = g_string_new ("");
2399
2296
value = _tmp0_;
2301
gboolean _tmp1_ = FALSE;
2305
gint skip_count = 0;
2418
2313
_tmp1_ = FALSE;
2420
if (!(_tmp4_ >= 0)) {
2315
if (!(_tmp3_ >= 0)) {
2423
2318
skip_count = 0;
2323
gboolean _tmp4_ = FALSE;
2436
ChessPiece* _tmp12_;
2437
ChessPiece* _tmp13_;
2439
ChessPiece* _tmp14_;
2327
ChessPiece* p = NULL;
2331
ChessPiece* _tmp10_ = NULL;
2332
ChessPiece* _tmp11_ = NULL;
2333
ChessPiece* _tmp12_ = NULL;
2341
if (!(_tmp6_ < 8)) {
2448
if (!(_tmp8_ < 8)) {
2453
_tmp11_ = chess_state_get_index (self, _tmp9_, _tmp10_);
2454
_tmp12_ = self->board[_tmp11_];
2455
_tmp13_ = _chess_piece_ref0 (_tmp12_);
2458
if (_tmp14_ == NULL) {
2460
_tmp15_ = skip_count;
2461
skip_count = _tmp15_ + 1;
2346
_tmp9_ = chess_state_get_index (self, _tmp7_, _tmp8_);
2347
_tmp10_ = self->board[_tmp9_];
2348
_tmp11_ = _chess_piece_ref0 (_tmp10_);
2351
if (_tmp12_ == NULL) {
2353
_tmp13_ = skip_count;
2354
skip_count = _tmp13_ + 1;
2465
ChessPiece* _tmp20_;
2468
_tmp16_ = skip_count;
2473
_tmp18_ = skip_count;
2474
g_string_append_printf (_tmp17_, "%d", _tmp18_);
2357
GString* _tmp17_ = NULL;
2358
ChessPiece* _tmp18_ = NULL;
2359
gunichar _tmp19_ = 0U;
2360
gunichar _tmp20_ = 0U;
2361
_tmp14_ = skip_count;
2363
GString* _tmp15_ = NULL;
2366
_tmp16_ = skip_count;
2367
g_string_append_printf (_tmp15_, "%d", _tmp16_);
2475
2368
skip_count = 0;
2479
_tmp21_ = chess_piece_get_symbol (_tmp20_);
2481
g_string_append_printf (_tmp19_, "%c", (gint) _tmp22_);
2372
_tmp19_ = chess_piece_get_symbol (_tmp18_);
2374
g_string_append_printf (_tmp17_, "%c", (gint) _tmp20_);
2483
2376
_chess_piece_unref0 (p);
2487
_tmp23_ = skip_count;
2492
_tmp25_ = skip_count;
2493
g_string_append_printf (_tmp24_, "%d", _tmp25_);
2380
_tmp21_ = skip_count;
2382
GString* _tmp22_ = NULL;
2385
_tmp23_ = skip_count;
2386
g_string_append_printf (_tmp22_, "%d", _tmp23_);
2499
g_string_append_c (_tmp27_, '/');
2390
GString* _tmp25_ = NULL;
2392
g_string_append_c (_tmp25_, '/');
2505
g_string_append_c (_tmp28_, ' ');
2506
_tmp29_ = self->current_player;
2507
_tmp30_ = _tmp29_->color;
2508
if (_tmp30_ == COLOR_WHITE) {
2511
g_string_append_c (_tmp31_, 'w');
2398
g_string_append_c (_tmp26_, ' ');
2399
_tmp27_ = self->current_player;
2400
_tmp28_ = _tmp27_->color;
2401
if (_tmp28_ == COLOR_WHITE) {
2402
GString* _tmp29_ = NULL;
2404
g_string_append_c (_tmp29_, 'w');
2515
g_string_append_c (_tmp32_, 'b');
2518
g_string_append_c (_tmp33_, ' ');
2519
_tmp34_ = self->can_castle_kingside[COLOR_WHITE];
2406
GString* _tmp30_ = NULL;
2408
g_string_append_c (_tmp30_, 'b');
2411
g_string_append_c (_tmp31_, ' ');
2412
_tmp32_ = self->can_castle_kingside[COLOR_WHITE];
2414
GString* _tmp33_ = NULL;
2416
g_string_append_c (_tmp33_, 'K');
2418
_tmp34_ = self->can_castle_queenside[COLOR_WHITE];
2420
GString* _tmp35_ = NULL;
2522
2421
_tmp35_ = value;
2523
g_string_append_c (_tmp35_, 'K');
2422
g_string_append_c (_tmp35_, 'Q');
2525
_tmp36_ = self->can_castle_queenside[COLOR_WHITE];
2424
_tmp36_ = self->can_castle_kingside[COLOR_BLACK];
2426
GString* _tmp37_ = NULL;
2528
2427
_tmp37_ = value;
2529
g_string_append_c (_tmp37_, 'Q');
2428
g_string_append_c (_tmp37_, 'k');
2531
_tmp38_ = self->can_castle_kingside[COLOR_BLACK];
2430
_tmp38_ = self->can_castle_queenside[COLOR_BLACK];
2432
GString* _tmp39_ = NULL;
2534
2433
_tmp39_ = value;
2535
g_string_append_c (_tmp39_, 'k');
2537
_tmp40_ = self->can_castle_queenside[COLOR_BLACK];
2541
g_string_append_c (_tmp41_, 'q');
2543
_tmp42_ = self->can_castle_kingside[COLOR_WHITE];
2544
_tmp43_ = self->can_castle_queenside[COLOR_WHITE];
2545
_tmp44_ = self->can_castle_kingside[COLOR_BLACK];
2546
_tmp45_ = self->can_castle_queenside[COLOR_BLACK];
2547
if (!(((_tmp42_ | _tmp43_) | _tmp44_) | _tmp45_)) {
2550
g_string_append_c (_tmp46_, '-');
2553
g_string_append_c (_tmp47_, ' ');
2554
_tmp48_ = self->en_passant_index;
2434
g_string_append_c (_tmp39_, 'q');
2436
_tmp40_ = self->can_castle_kingside[COLOR_WHITE];
2437
_tmp41_ = self->can_castle_queenside[COLOR_WHITE];
2438
_tmp42_ = self->can_castle_kingside[COLOR_BLACK];
2439
_tmp43_ = self->can_castle_queenside[COLOR_BLACK];
2440
if (!(((_tmp40_ | _tmp41_) | _tmp42_) | _tmp43_)) {
2441
GString* _tmp44_ = NULL;
2443
g_string_append_c (_tmp44_, '-');
2446
g_string_append_c (_tmp45_, ' ');
2447
_tmp46_ = self->en_passant_index;
2449
GString* _tmp47_ = NULL;
2558
2453
gint _tmp51_ = 0;
2455
_tmp48_ = self->en_passant_index;
2456
_tmp49_ = chess_state_get_file (self, _tmp48_);
2562
2457
_tmp50_ = self->en_passant_index;
2563
_tmp51_ = chess_state_get_file (self, _tmp50_);
2564
_tmp52_ = self->en_passant_index;
2565
_tmp53_ = chess_state_get_rank (self, _tmp52_);
2566
g_string_append_printf (_tmp49_, "%c%d", 'a' + _tmp51_, _tmp53_ + 1);
2458
_tmp51_ = chess_state_get_rank (self, _tmp50_);
2459
g_string_append_printf (_tmp47_, "%c%d", 'a' + _tmp49_, _tmp51_ + 1);
2570
g_string_append_c (_tmp54_, '-');
2461
GString* _tmp52_ = NULL;
2463
g_string_append_c (_tmp52_, '-');
2573
g_string_append_c (_tmp55_, ' ');
2466
g_string_append_c (_tmp53_, ' ');
2468
_tmp55_ = self->halfmove_clock;
2469
g_string_append_printf (_tmp54_, "%d", _tmp55_);
2574
2470
_tmp56_ = value;
2575
_tmp57_ = self->halfmove_clock;
2576
g_string_append_printf (_tmp56_, "%d", _tmp57_);
2578
g_string_append_c (_tmp58_, ' ');
2579
_tmp59_ = self->current_player;
2580
_tmp60_ = _tmp59_->color;
2581
if (_tmp60_ == COLOR_WHITE) {
2471
g_string_append_c (_tmp56_, ' ');
2472
_tmp57_ = self->current_player;
2473
_tmp58_ = _tmp57_->color;
2474
if (_tmp58_ == COLOR_WHITE) {
2475
GString* _tmp59_ = NULL;
2478
_tmp60_ = self->number;
2479
g_string_append_printf (_tmp59_, "%d", _tmp60_ / 2);
2481
GString* _tmp61_ = NULL;
2584
2483
_tmp61_ = value;
2585
2484
_tmp62_ = self->number;
2586
g_string_append_printf (_tmp61_, "%d", _tmp62_ / 2);
2591
_tmp64_ = self->number;
2592
g_string_append_printf (_tmp63_, "%d", (_tmp64_ / 2) + 1);
2485
g_string_append_printf (_tmp61_, "%d", (_tmp62_ / 2) + 1);
2595
_tmp66_ = _tmp65_->str;
2596
_tmp67_ = g_strdup (_tmp66_);
2488
_tmp64_ = _tmp63_->str;
2489
_tmp65_ = g_strdup (_tmp64_);
2598
2491
_g_string_free0 (value);
2931
2812
is_promotion = FALSE;
2932
2813
ambiguous_rank = FALSE;
2933
2814
ambiguous_file = FALSE;
2935
_tmp46_ = _tmp45_->type;
2816
_tmp43_ = _tmp42_->type;
2937
2818
case PIECE_TYPE_PAWN:
2939
gboolean _tmp47_ = FALSE;
2940
ChessPiece* _tmp48_;
2944
gboolean _tmp64_ = FALSE;
2947
ChessPiece* _tmp68_;
2949
if (_tmp48_ == NULL) {
2953
_tmp50_ = self->en_passant_index;
2954
_tmp47_ = _tmp49_ == _tmp50_;
2820
gboolean _tmp44_ = FALSE;
2821
ChessPiece* _tmp45_ = NULL;
2824
gboolean _tmp59_ = FALSE;
2826
ChessPiece* _tmp62_ = NULL;
2828
if (_tmp45_ == NULL) {
2832
_tmp47_ = self->en_passant_index;
2833
_tmp44_ = _tmp46_ == _tmp47_;
2960
2842
gint _tmp52_ = 0;
2966
ChessPiece* _tmp58_;
2967
ChessPiece* _tmp59_;
2843
ChessPiece* _tmp53_ = NULL;
2844
ChessPiece* _tmp54_ = NULL;
2976
_tmp56_ = chess_state_get_index (self, _tmp54_, _tmp55_);
2977
victim_index = _tmp56_;
2978
_tmp57_ = victim_index;
2979
_tmp58_ = self->board[_tmp57_];
2980
_tmp59_ = _chess_piece_ref0 (_tmp58_);
2852
_tmp51_ = chess_state_get_index (self, _tmp48_, _tmp50_);
2853
victim_index = _tmp51_;
2854
_tmp52_ = victim_index;
2855
_tmp53_ = self->board[_tmp52_];
2856
_tmp54_ = _chess_piece_ref0 (_tmp53_);
2981
2857
_chess_piece_unref0 (victim);
2986
if (_tmp60_ != _tmp61_) {
2987
ChessPiece* _tmp62_;
2989
if (_tmp62_ == NULL) {
2991
_chess_piece_unref0 (victim);
2992
_chess_piece_unref0 (piece);
2996
ChessPiece* _tmp63_;
2998
if (_tmp63_ != NULL) {
3000
_chess_piece_unref0 (victim);
3001
_chess_piece_unref0 (piece);
3011
_tmp64_ = _tmp66_ == 7;
3014
is_promotion = _tmp67_;
3016
if (_tmp68_ != NULL) {
2862
if (_tmp55_ != _tmp56_) {
2863
ChessPiece* _tmp57_ = NULL;
2865
if (_tmp57_ == NULL) {
2867
_chess_piece_unref0 (victim);
2868
_chess_piece_unref0 (piece);
2872
ChessPiece* _tmp58_ = NULL;
2874
if (_tmp58_ != NULL) {
2876
_chess_piece_unref0 (victim);
2877
_chess_piece_unref0 (piece);
2887
_tmp59_ = _tmp61_ == 7;
2889
is_promotion = _tmp59_;
2891
if (_tmp62_ != NULL) {
3017
2892
ambiguous_file = TRUE;
3021
2896
case PIECE_TYPE_KING:
3028
_tmp71_ = abs (_tmp69_ - _tmp70_);
2903
_tmp65_ = abs (_tmp63_ - _tmp64_);
3030
2911
gint _tmp72_ = 0;
3035
2914
gint _tmp77_ = 0;
3036
2915
gint _tmp78_ = 0;
3045
ChessPiece* _tmp93_;
3046
ChessPiece* _tmp94_;
3048
gboolean _tmp95_ = FALSE;
3049
gboolean _tmp96_ = FALSE;
3050
ChessPiece* _tmp97_;
3056
gint64 rook_over_mask;
3060
CheckState _tmp112_;
3061
ChessPlayer* _tmp113_;
3068
gboolean _tmp120_ = FALSE;
3071
if (_tmp73_ > _tmp74_) {
3078
_tmp77_ = chess_state_get_index (self, _tmp75_, _tmp76_);
3079
rook_start = _tmp77_;
3082
if (_tmp79_ > _tmp80_) {
3085
_tmp78_ = _tmp81_ - 1;
3089
_tmp78_ = _tmp82_ + 1;
3093
_tmp85_ = chess_state_get_index (self, _tmp83_, _tmp84_);
3097
if (_tmp86_ > _tmp87_) {
3101
_tmp89_ = self->can_castle_kingside[_tmp88_];
3104
_chess_piece_unref0 (victim);
3105
_chess_piece_unref0 (piece);
3112
_tmp91_ = self->can_castle_queenside[_tmp90_];
3115
_chess_piece_unref0 (victim);
3116
_chess_piece_unref0 (piece);
3120
_tmp92_ = rook_start;
3121
_tmp93_ = self->board[_tmp92_];
3122
_tmp94_ = _chess_piece_ref0 (_tmp93_);
3125
if (_tmp97_ == NULL) {
3128
ChessPiece* _tmp98_;
3131
_tmp99_ = _tmp98_->type;
3132
_tmp96_ = _tmp99_ != PIECE_TYPE_ROOK;
3138
ChessPiece* _tmp101_;
3143
_tmp102_ = chess_piece_get_color (_tmp101_);
3144
_tmp103_ = _tmp102_;
3146
_tmp95_ = _tmp103_ != _tmp104_;
3151
_chess_piece_unref0 (rook);
3152
_chess_piece_unref0 (victim);
3153
_chess_piece_unref0 (piece);
3156
_tmp106_ = rook_start;
3157
_tmp107_ = rook_end;
3158
_tmp108_ = BIT_BOARD_over_masks[(_tmp106_ * 64) + _tmp107_];
3159
rook_over_mask = _tmp108_;
3160
_tmp109_ = rook_over_mask;
3161
_tmp110_ = self->priv->piece_masks[COLOR_WHITE];
3162
_tmp111_ = self->priv->piece_masks[COLOR_BLACK];
3163
if ((_tmp109_ & (_tmp110_ | _tmp111_)) != ((gint64) 0)) {
3165
_chess_piece_unref0 (rook);
3166
_chess_piece_unref0 (victim);
3167
_chess_piece_unref0 (piece);
3170
_tmp112_ = self->check_state;
3171
if (_tmp112_ == CHECK_STATE_CHECK) {
3173
_chess_piece_unref0 (rook);
3174
_chess_piece_unref0 (victim);
3175
_chess_piece_unref0 (piece);
3181
_tmp116_ = rook_end;
3182
_tmp117_ = chess_state_get_rank (self, _tmp116_);
3183
_tmp118_ = rook_end;
3184
_tmp119_ = chess_state_get_file (self, _tmp118_);
3185
_tmp120_ = chess_state_move_with_coords (self, _tmp113_, _tmp114_, _tmp115_, _tmp117_, _tmp119_, PIECE_TYPE_QUEEN, FALSE, TRUE);
2917
ChessPiece* rook = NULL;
2919
ChessPiece* _tmp85_ = NULL;
2920
ChessPiece* _tmp86_ = NULL;
2921
gboolean _tmp87_ = FALSE;
2922
gboolean _tmp88_ = FALSE;
2923
ChessPiece* _tmp89_ = NULL;
2924
gint64 rook_over_mask = 0LL;
2927
gint64 _tmp98_ = 0LL;
2928
gint64 _tmp99_ = 0LL;
2929
gint64 _tmp100_ = 0LL;
2930
gint64 _tmp101_ = 0LL;
2931
CheckState _tmp102_ = 0;
2932
ChessPlayer* _tmp103_ = NULL;
2939
gboolean _tmp110_ = FALSE;
2942
if (_tmp67_ > _tmp68_) {
2948
_tmp70_ = chess_state_get_index (self, _tmp69_, _tmp66_);
2949
rook_start = _tmp70_;
2952
if (_tmp72_ > _tmp73_) {
2955
_tmp71_ = _tmp74_ - 1;
2959
_tmp71_ = _tmp75_ + 1;
2962
_tmp77_ = chess_state_get_index (self, _tmp76_, _tmp71_);
2966
if (_tmp78_ > _tmp79_) {
2968
gboolean _tmp81_ = FALSE;
2970
_tmp81_ = self->can_castle_kingside[_tmp80_];
2973
_chess_piece_unref0 (victim);
2974
_chess_piece_unref0 (piece);
2979
gboolean _tmp83_ = FALSE;
2981
_tmp83_ = self->can_castle_queenside[_tmp82_];
2984
_chess_piece_unref0 (victim);
2985
_chess_piece_unref0 (piece);
2989
_tmp84_ = rook_start;
2990
_tmp85_ = self->board[_tmp84_];
2991
_tmp86_ = _chess_piece_ref0 (_tmp85_);
2994
if (_tmp89_ == NULL) {
2997
ChessPiece* _tmp90_ = NULL;
2998
PieceType _tmp91_ = 0;
3000
_tmp91_ = _tmp90_->type;
3001
_tmp88_ = _tmp91_ != PIECE_TYPE_ROOK;
3006
ChessPiece* _tmp92_ = NULL;
3011
_tmp93_ = chess_piece_get_color (_tmp92_);
3014
_tmp87_ = _tmp94_ != _tmp95_;
3018
_chess_piece_unref0 (rook);
3019
_chess_piece_unref0 (victim);
3020
_chess_piece_unref0 (piece);
3023
_tmp96_ = rook_start;
3025
_tmp98_ = BIT_BOARD_over_masks[(_tmp96_ * 64) + _tmp97_];
3026
rook_over_mask = _tmp98_;
3027
_tmp99_ = rook_over_mask;
3028
_tmp100_ = self->priv->piece_masks[COLOR_WHITE];
3029
_tmp101_ = self->priv->piece_masks[COLOR_BLACK];
3030
if ((_tmp99_ & (_tmp100_ | _tmp101_)) != ((gint64) 0)) {
3032
_chess_piece_unref0 (rook);
3033
_chess_piece_unref0 (victim);
3034
_chess_piece_unref0 (piece);
3037
_tmp102_ = self->check_state;
3038
if (_tmp102_ == CHECK_STATE_CHECK) {
3040
_chess_piece_unref0 (rook);
3041
_chess_piece_unref0 (victim);
3042
_chess_piece_unref0 (piece);
3048
_tmp106_ = rook_end;
3049
_tmp107_ = chess_state_get_rank (self, _tmp106_);
3050
_tmp108_ = rook_end;
3051
_tmp109_ = chess_state_get_file (self, _tmp108_);
3052
_tmp110_ = chess_state_move_with_coords (self, _tmp103_, _tmp104_, _tmp105_, _tmp107_, _tmp109_, PIECE_TYPE_QUEEN, FALSE, TRUE);
3187
3054
result = FALSE;
3188
3055
_chess_piece_unref0 (rook);
3189
3056
_chess_piece_unref0 (victim);
3335
_tmp161_ = self->priv->piece_masks[COLOR_WHITE];
3336
old_white_mask = _tmp161_;
3195
_tmp147_ = self->priv->piece_masks[COLOR_WHITE];
3196
old_white_mask = _tmp147_;
3197
_tmp148_ = self->priv->piece_masks[COLOR_BLACK];
3198
old_black_mask = _tmp148_;
3199
_tmp149_ = self->can_castle_kingside[COLOR_WHITE];
3200
old_white_can_castle_kingside = _tmp149_;
3201
_tmp150_ = self->can_castle_queenside[COLOR_WHITE];
3202
old_white_can_castle_queenside = _tmp150_;
3203
_tmp151_ = self->can_castle_kingside[COLOR_BLACK];
3204
old_black_can_castle_kingside = _tmp151_;
3205
_tmp152_ = self->can_castle_queenside[COLOR_BLACK];
3206
old_black_can_castle_queenside = _tmp152_;
3207
_tmp153_ = self->en_passant_index;
3208
old_en_passant_index = _tmp153_;
3209
_tmp154_ = self->halfmove_clock;
3210
old_halfmove_clock = _tmp154_;
3212
_chess_piece_unref0 (self->board[_tmp155_]);
3213
self->board[_tmp155_] = NULL;
3214
_tmp156_ = self->board[_tmp155_];
3216
_tmp158_ = BIT_BOARD_clear_location_masks[_tmp157_];
3217
self->priv->piece_masks[COLOR_WHITE] &= _tmp158_;
3218
_tmp159_ = self->priv->piece_masks[COLOR_WHITE];
3220
_tmp161_ = BIT_BOARD_clear_location_masks[_tmp160_];
3221
self->priv->piece_masks[COLOR_BLACK] &= _tmp161_;
3337
3222
_tmp162_ = self->priv->piece_masks[COLOR_BLACK];
3338
old_black_mask = _tmp162_;
3339
_tmp163_ = self->can_castle_kingside[COLOR_WHITE];
3340
old_white_can_castle_kingside = _tmp163_;
3341
_tmp164_ = self->can_castle_queenside[COLOR_WHITE];
3342
old_white_can_castle_queenside = _tmp164_;
3343
_tmp165_ = self->can_castle_kingside[COLOR_BLACK];
3344
old_black_can_castle_kingside = _tmp165_;
3345
_tmp166_ = self->can_castle_queenside[COLOR_BLACK];
3346
old_black_can_castle_queenside = _tmp166_;
3347
_tmp167_ = self->en_passant_index;
3348
old_en_passant_index = _tmp167_;
3349
_tmp168_ = self->halfmove_clock;
3350
old_halfmove_clock = _tmp168_;
3352
_chess_piece_unref0 (self->board[_tmp169_]);
3353
self->board[_tmp169_] = NULL;
3354
_tmp170_ = self->board[_tmp169_];
3356
_tmp172_ = BIT_BOARD_clear_location_masks[_tmp171_];
3357
self->priv->piece_masks[COLOR_WHITE] &= _tmp172_;
3358
_tmp173_ = self->priv->piece_masks[COLOR_WHITE];
3360
_tmp175_ = BIT_BOARD_clear_location_masks[_tmp174_];
3361
self->priv->piece_masks[COLOR_BLACK] &= _tmp175_;
3362
_tmp176_ = self->priv->piece_masks[COLOR_BLACK];
3364
if (_tmp177_ != NULL) {
3366
ChessPiece* _tmp179_;
3373
_tmp178_ = victim_index;
3224
if (_tmp163_ != NULL) {
3226
ChessPiece* _tmp165_ = NULL;
3228
gint64 _tmp167_ = 0LL;
3229
gint64 _tmp168_ = 0LL;
3231
gint64 _tmp170_ = 0LL;
3232
gint64 _tmp171_ = 0LL;
3233
_tmp164_ = victim_index;
3234
_chess_piece_unref0 (self->board[_tmp164_]);
3235
self->board[_tmp164_] = NULL;
3236
_tmp165_ = self->board[_tmp164_];
3237
_tmp166_ = victim_index;
3238
_tmp167_ = BIT_BOARD_clear_location_masks[_tmp166_];
3239
self->priv->piece_masks[COLOR_WHITE] &= _tmp167_;
3240
_tmp168_ = self->priv->piece_masks[COLOR_WHITE];
3241
_tmp169_ = victim_index;
3242
_tmp170_ = BIT_BOARD_clear_location_masks[_tmp169_];
3243
self->priv->piece_masks[COLOR_BLACK] &= _tmp170_;
3244
_tmp171_ = self->priv->piece_masks[COLOR_BLACK];
3246
_tmp172_ = is_promotion;
3249
ChessPlayer* _tmp174_ = NULL;
3250
PieceType _tmp175_ = 0;
3251
ChessPiece* _tmp176_ = NULL;
3252
ChessPiece* _tmp177_ = NULL;
3255
_tmp175_ = promotion_type;
3256
_tmp176_ = chess_piece_new (_tmp174_, _tmp175_);
3257
_chess_piece_unref0 (self->board[_tmp173_]);
3258
self->board[_tmp173_] = _tmp176_;
3259
_tmp177_ = self->board[_tmp173_];
3262
ChessPiece* _tmp179_ = NULL;
3263
ChessPiece* _tmp180_ = NULL;
3264
ChessPiece* _tmp181_ = NULL;
3267
_tmp180_ = _chess_piece_ref0 (_tmp179_);
3374
3268
_chess_piece_unref0 (self->board[_tmp178_]);
3375
self->board[_tmp178_] = NULL;
3376
_tmp179_ = self->board[_tmp178_];
3377
_tmp180_ = victim_index;
3378
_tmp181_ = BIT_BOARD_clear_location_masks[_tmp180_];
3379
self->priv->piece_masks[COLOR_WHITE] &= _tmp181_;
3380
_tmp182_ = self->priv->piece_masks[COLOR_WHITE];
3381
_tmp183_ = victim_index;
3382
_tmp184_ = BIT_BOARD_clear_location_masks[_tmp183_];
3383
self->priv->piece_masks[COLOR_BLACK] &= _tmp184_;
3384
_tmp185_ = self->priv->piece_masks[COLOR_BLACK];
3386
_tmp186_ = is_promotion;
3389
ChessPlayer* _tmp188_;
3391
ChessPiece* _tmp190_;
3392
ChessPiece* _tmp191_;
3395
_tmp189_ = promotion_type;
3396
_tmp190_ = chess_piece_new (_tmp188_, _tmp189_);
3397
_chess_piece_unref0 (self->board[_tmp187_]);
3398
self->board[_tmp187_] = _tmp190_;
3399
_tmp191_ = self->board[_tmp187_];
3402
ChessPiece* _tmp193_;
3403
ChessPiece* _tmp194_;
3404
ChessPiece* _tmp195_;
3407
_tmp194_ = _chess_piece_ref0 (_tmp193_);
3408
_chess_piece_unref0 (self->board[_tmp192_]);
3409
self->board[_tmp192_] = _tmp194_;
3410
_tmp195_ = self->board[_tmp192_];
3413
_tmp197_ = end_mask;
3414
self->priv->piece_masks[_tmp196_] |= _tmp197_;
3415
_tmp198_ = self->priv->piece_masks[_tmp196_];
3416
_tmp199_ = opponent_color;
3418
_tmp201_ = BIT_BOARD_clear_location_masks[_tmp200_];
3419
self->priv->piece_masks[_tmp199_] &= _tmp201_;
3420
_tmp202_ = self->priv->piece_masks[_tmp199_];
3421
_tmp203_ = rook_start;
3422
if (_tmp203_ >= 0) {
3424
ChessPiece* _tmp205_;
3425
ChessPiece* _tmp206_;
3428
ChessPiece* _tmp208_;
3434
ChessPiece* _tmp214_;
3435
ChessPiece* _tmp215_;
3436
ChessPiece* _tmp216_;
3441
_tmp204_ = rook_start;
3442
_tmp205_ = self->board[_tmp204_];
3443
_tmp206_ = _chess_piece_ref0 (_tmp205_);
3445
_tmp207_ = rook_start;
3446
_chess_piece_unref0 (self->board[_tmp207_]);
3447
self->board[_tmp207_] = NULL;
3448
_tmp208_ = self->board[_tmp207_];
3269
self->board[_tmp178_] = _tmp180_;
3270
_tmp181_ = self->board[_tmp178_];
3273
_tmp183_ = end_mask;
3274
self->priv->piece_masks[_tmp182_] |= _tmp183_;
3275
_tmp184_ = self->priv->piece_masks[_tmp182_];
3276
_tmp185_ = opponent_color;
3278
_tmp187_ = BIT_BOARD_clear_location_masks[_tmp186_];
3279
self->priv->piece_masks[_tmp185_] &= _tmp187_;
3280
_tmp188_ = self->priv->piece_masks[_tmp185_];
3281
_tmp189_ = rook_start;
3282
if (_tmp189_ >= 0) {
3283
ChessPiece* rook = NULL;
3285
ChessPiece* _tmp191_ = NULL;
3286
ChessPiece* _tmp192_ = NULL;
3288
ChessPiece* _tmp194_ = NULL;
3291
gint64 _tmp197_ = 0LL;
3292
gint64 _tmp198_ = 0LL;
3294
ChessPiece* _tmp200_ = NULL;
3295
ChessPiece* _tmp201_ = NULL;
3296
ChessPiece* _tmp202_ = NULL;
3299
gint64 _tmp205_ = 0LL;
3300
gint64 _tmp206_ = 0LL;
3301
_tmp190_ = rook_start;
3302
_tmp191_ = self->board[_tmp190_];
3303
_tmp192_ = _chess_piece_ref0 (_tmp191_);
3305
_tmp193_ = rook_start;
3306
_chess_piece_unref0 (self->board[_tmp193_]);
3307
self->board[_tmp193_] = NULL;
3308
_tmp194_ = self->board[_tmp193_];
3310
_tmp196_ = rook_start;
3311
_tmp197_ = BIT_BOARD_clear_location_masks[_tmp196_];
3312
self->priv->piece_masks[_tmp195_] &= _tmp197_;
3313
_tmp198_ = self->priv->piece_masks[_tmp195_];
3314
_tmp199_ = rook_end;
3316
_tmp201_ = _chess_piece_ref0 (_tmp200_);
3317
_chess_piece_unref0 (self->board[_tmp199_]);
3318
self->board[_tmp199_] = _tmp201_;
3319
_tmp202_ = self->board[_tmp199_];
3321
_tmp204_ = rook_end;
3322
_tmp205_ = BIT_BOARD_set_location_masks[_tmp204_];
3323
self->priv->piece_masks[_tmp203_] |= _tmp205_;
3324
_tmp206_ = self->priv->piece_masks[_tmp203_];
3325
_chess_piece_unref0 (rook);
3328
_tmp208_ = _tmp207_->type;
3329
if (_tmp208_ == PIECE_TYPE_KING) {
3331
gboolean _tmp210_ = FALSE;
3333
gboolean _tmp212_ = FALSE;
3449
3334
_tmp209_ = color;
3450
_tmp210_ = rook_start;
3451
_tmp211_ = BIT_BOARD_clear_location_masks[_tmp210_];
3452
self->priv->piece_masks[_tmp209_] &= _tmp211_;
3453
_tmp212_ = self->priv->piece_masks[_tmp209_];
3454
_tmp213_ = rook_end;
3456
_tmp215_ = _chess_piece_ref0 (_tmp214_);
3457
_chess_piece_unref0 (self->board[_tmp213_]);
3458
self->board[_tmp213_] = _tmp215_;
3459
_tmp216_ = self->board[_tmp213_];
3461
_tmp218_ = rook_end;
3462
_tmp219_ = BIT_BOARD_set_location_masks[_tmp218_];
3463
self->priv->piece_masks[_tmp217_] |= _tmp219_;
3464
_tmp220_ = self->priv->piece_masks[_tmp217_];
3465
_chess_piece_unref0 (rook);
3468
_tmp222_ = _tmp221_->type;
3469
if (_tmp222_ == PIECE_TYPE_KING) {
3475
self->can_castle_kingside[_tmp223_] = FALSE;
3476
_tmp224_ = self->can_castle_kingside[_tmp223_];
3478
self->can_castle_queenside[_tmp225_] = FALSE;
3479
_tmp226_ = self->can_castle_queenside[_tmp225_];
3335
self->can_castle_kingside[_tmp209_] = FALSE;
3336
_tmp210_ = self->can_castle_kingside[_tmp209_];
3338
self->can_castle_queenside[_tmp211_] = FALSE;
3339
_tmp212_ = self->can_castle_queenside[_tmp211_];
3481
ChessPiece* _tmp227_;
3484
_tmp228_ = _tmp227_->type;
3485
if (_tmp228_ == PIECE_TYPE_ROOK) {
3493
if (_tmp230_ == COLOR_WHITE) {
3341
ChessPiece* _tmp213_ = NULL;
3342
PieceType _tmp214_ = 0;
3344
_tmp214_ = _tmp213_->type;
3345
if (_tmp214_ == PIECE_TYPE_ROOK) {
3352
if (_tmp216_ == COLOR_WHITE) {
3498
_tmp231_ = _tmp229_;
3499
base_rank = _tmp231_;
3501
_tmp233_ = base_rank;
3502
if (_tmp232_ == _tmp233_) {
3505
if (_tmp234_ == 0) {
3509
self->can_castle_queenside[_tmp235_] = FALSE;
3510
_tmp236_ = self->can_castle_queenside[_tmp235_];
3357
base_rank = _tmp215_;
3359
_tmp218_ = base_rank;
3360
if (_tmp217_ == _tmp218_) {
3363
if (_tmp219_ == 0) {
3365
gboolean _tmp221_ = FALSE;
3367
self->can_castle_queenside[_tmp220_] = FALSE;
3368
_tmp221_ = self->can_castle_queenside[_tmp220_];
3514
if (_tmp237_ == 7) {
3518
self->can_castle_kingside[_tmp238_] = FALSE;
3519
_tmp239_ = self->can_castle_kingside[_tmp238_];
3372
if (_tmp222_ == 7) {
3374
gboolean _tmp224_ = FALSE;
3376
self->can_castle_kingside[_tmp223_] = FALSE;
3377
_tmp224_ = self->can_castle_kingside[_tmp223_];
3524
gboolean _tmp240_ = FALSE;
3525
ChessPiece* _tmp241_;
3528
if (_tmp241_ != NULL) {
3529
ChessPiece* _tmp242_;
3532
_tmp243_ = _tmp242_->type;
3533
_tmp240_ = _tmp243_ == PIECE_TYPE_ROOK;
3382
gboolean _tmp225_ = FALSE;
3383
ChessPiece* _tmp226_ = NULL;
3385
if (_tmp226_ != NULL) {
3386
ChessPiece* _tmp227_ = NULL;
3387
PieceType _tmp228_ = 0;
3389
_tmp228_ = _tmp227_->type;
3390
_tmp225_ = _tmp228_ == PIECE_TYPE_ROOK;
3537
_tmp244_ = _tmp240_;
3545
_tmp246_ = opponent_color;
3546
if (_tmp246_ == COLOR_WHITE) {
3400
_tmp230_ = opponent_color;
3401
if (_tmp230_ == COLOR_WHITE) {
3551
_tmp247_ = _tmp245_;
3552
base_rank = _tmp247_;
3554
_tmp249_ = base_rank;
3555
if (_tmp248_ == _tmp249_) {
3558
if (_tmp250_ == 0) {
3561
_tmp251_ = opponent_color;
3562
self->can_castle_queenside[_tmp251_] = FALSE;
3563
_tmp252_ = self->can_castle_queenside[_tmp251_];
3406
base_rank = _tmp229_;
3408
_tmp232_ = base_rank;
3409
if (_tmp231_ == _tmp232_) {
3412
if (_tmp233_ == 0) {
3414
gboolean _tmp235_ = FALSE;
3415
_tmp234_ = opponent_color;
3416
self->can_castle_queenside[_tmp234_] = FALSE;
3417
_tmp235_ = self->can_castle_queenside[_tmp234_];
3567
if (_tmp253_ == 7) {
3570
_tmp254_ = opponent_color;
3571
self->can_castle_kingside[_tmp254_] = FALSE;
3572
_tmp255_ = self->can_castle_kingside[_tmp254_];
3421
if (_tmp236_ == 7) {
3423
gboolean _tmp238_ = FALSE;
3424
_tmp237_ = opponent_color;
3425
self->can_castle_kingside[_tmp237_] = FALSE;
3426
_tmp238_ = self->can_castle_kingside[_tmp237_];
3580
_tmp258_ = _tmp257_->type;
3581
if (_tmp258_ == PIECE_TYPE_PAWN) {
3583
_tmp259_ = over_mask;
3584
_tmp256_ = _tmp259_ != ((gint64) 0);
3434
_tmp241_ = _tmp240_->type;
3435
if (_tmp241_ == PIECE_TYPE_PAWN) {
3436
gint64 _tmp242_ = 0LL;
3437
_tmp242_ = over_mask;
3438
_tmp239_ = _tmp242_ != ((gint64) 0);
3588
_tmp260_ = _tmp256_;
3597
_tmp264_ = chess_state_get_index (self, (_tmp261_ + _tmp262_) / 2, _tmp263_);
3598
self->en_passant_index = _tmp264_;
3450
_tmp246_ = chess_state_get_index (self, (_tmp243_ + _tmp244_) / 2, _tmp245_);
3451
self->en_passant_index = _tmp246_;
3600
3453
self->en_passant_index = -1;
3603
_tmp267_ = _tmp266_->type;
3604
if (_tmp267_ == PIECE_TYPE_PAWN) {
3456
_tmp249_ = _tmp248_->type;
3457
if (_tmp249_ == PIECE_TYPE_PAWN) {
3607
ChessPiece* _tmp268_;
3609
_tmp265_ = _tmp268_ != NULL;
3460
ChessPiece* _tmp250_ = NULL;
3462
_tmp247_ = _tmp250_ != NULL;
3611
_tmp269_ = _tmp265_;
3613
3465
self->halfmove_clock = 0;
3616
_tmp270_ = self->halfmove_clock;
3617
self->halfmove_clock = _tmp270_ + 1;
3468
_tmp251_ = self->halfmove_clock;
3469
self->halfmove_clock = _tmp251_ + 1;
3619
3471
_result_ = TRUE;
3620
_tmp272_ = test_check;
3622
ChessPlayer* _tmp273_;
3623
gboolean _tmp274_ = FALSE;
3625
_tmp274_ = chess_state_is_in_check (self, _tmp273_);
3626
_tmp271_ = _tmp274_;
3472
_tmp253_ = test_check;
3474
ChessPlayer* _tmp254_ = NULL;
3475
gboolean _tmp255_ = FALSE;
3477
_tmp255_ = chess_state_is_in_check (self, _tmp254_);
3478
_tmp252_ = _tmp255_;
3630
_tmp275_ = _tmp271_;
3632
3483
_result_ = FALSE;
3639
_tmp278_ = _result_;
3640
_tmp276_ = !_tmp278_;
3489
gboolean _tmp258_ = FALSE;
3490
_tmp258_ = _result_;
3491
_tmp256_ = !_tmp258_;
3642
_tmp279_ = _tmp276_;
3645
ChessPiece* _tmp281_;
3646
ChessPiece* _tmp282_;
3647
ChessPiece* _tmp283_;
3649
ChessPiece* _tmp285_;
3650
ChessPiece* _tmp286_;
3668
_tmp282_ = _chess_piece_ref0 (_tmp281_);
3669
_chess_piece_unref0 (self->board[_tmp280_]);
3670
self->board[_tmp280_] = _tmp282_;
3671
_tmp283_ = self->board[_tmp280_];
3673
_chess_piece_unref0 (self->board[_tmp284_]);
3674
self->board[_tmp284_] = NULL;
3675
_tmp285_ = self->board[_tmp284_];
3677
if (_tmp286_ != NULL) {
3679
ChessPiece* _tmp288_;
3680
ChessPiece* _tmp289_;
3681
ChessPiece* _tmp290_;
3682
_tmp287_ = victim_index;
3684
_tmp289_ = _chess_piece_ref0 (_tmp288_);
3685
_chess_piece_unref0 (self->board[_tmp287_]);
3686
self->board[_tmp287_] = _tmp289_;
3687
_tmp290_ = self->board[_tmp287_];
3495
ChessPiece* _tmp260_ = NULL;
3496
ChessPiece* _tmp261_ = NULL;
3497
ChessPiece* _tmp262_ = NULL;
3499
ChessPiece* _tmp264_ = NULL;
3500
ChessPiece* _tmp265_ = NULL;
3502
gint64 _tmp280_ = 0LL;
3503
gint64 _tmp281_ = 0LL;
3504
gint64 _tmp282_ = 0LL;
3505
gint64 _tmp283_ = 0LL;
3506
gboolean _tmp284_ = FALSE;
3507
gboolean _tmp285_ = FALSE;
3508
gboolean _tmp286_ = FALSE;
3509
gboolean _tmp287_ = FALSE;
3510
gboolean _tmp288_ = FALSE;
3511
gboolean _tmp289_ = FALSE;
3512
gboolean _tmp290_ = FALSE;
3513
gboolean _tmp291_ = FALSE;
3518
_tmp261_ = _chess_piece_ref0 (_tmp260_);
3519
_chess_piece_unref0 (self->board[_tmp259_]);
3520
self->board[_tmp259_] = _tmp261_;
3521
_tmp262_ = self->board[_tmp259_];
3523
_chess_piece_unref0 (self->board[_tmp263_]);
3524
self->board[_tmp263_] = NULL;
3525
_tmp264_ = self->board[_tmp263_];
3527
if (_tmp265_ != NULL) {
3529
ChessPiece* _tmp267_ = NULL;
3530
ChessPiece* _tmp268_ = NULL;
3531
ChessPiece* _tmp269_ = NULL;
3532
_tmp266_ = victim_index;
3534
_tmp268_ = _chess_piece_ref0 (_tmp267_);
3535
_chess_piece_unref0 (self->board[_tmp266_]);
3536
self->board[_tmp266_] = _tmp268_;
3537
_tmp269_ = self->board[_tmp266_];
3689
_tmp291_ = rook_start;
3690
if (_tmp291_ >= 0) {
3692
ChessPiece* _tmp293_;
3693
ChessPiece* _tmp294_;
3696
ChessPiece* _tmp296_;
3697
ChessPiece* _tmp297_;
3698
ChessPiece* _tmp298_;
3700
ChessPiece* _tmp300_;
3701
_tmp292_ = rook_end;
3702
_tmp293_ = self->board[_tmp292_];
3703
_tmp294_ = _chess_piece_ref0 (_tmp293_);
3705
_tmp295_ = rook_start;
3707
_tmp297_ = _chess_piece_ref0 (_tmp296_);
3708
_chess_piece_unref0 (self->board[_tmp295_]);
3709
self->board[_tmp295_] = _tmp297_;
3710
_tmp298_ = self->board[_tmp295_];
3711
_tmp299_ = rook_end;
3712
_chess_piece_unref0 (self->board[_tmp299_]);
3713
self->board[_tmp299_] = NULL;
3714
_tmp300_ = self->board[_tmp299_];
3539
_tmp270_ = rook_start;
3540
if (_tmp270_ >= 0) {
3541
ChessPiece* rook = NULL;
3543
ChessPiece* _tmp272_ = NULL;
3544
ChessPiece* _tmp273_ = NULL;
3546
ChessPiece* _tmp275_ = NULL;
3547
ChessPiece* _tmp276_ = NULL;
3548
ChessPiece* _tmp277_ = NULL;
3550
ChessPiece* _tmp279_ = NULL;
3551
_tmp271_ = rook_end;
3552
_tmp272_ = self->board[_tmp271_];
3553
_tmp273_ = _chess_piece_ref0 (_tmp272_);
3555
_tmp274_ = rook_start;
3557
_tmp276_ = _chess_piece_ref0 (_tmp275_);
3558
_chess_piece_unref0 (self->board[_tmp274_]);
3559
self->board[_tmp274_] = _tmp276_;
3560
_tmp277_ = self->board[_tmp274_];
3561
_tmp278_ = rook_end;
3562
_chess_piece_unref0 (self->board[_tmp278_]);
3563
self->board[_tmp278_] = NULL;
3564
_tmp279_ = self->board[_tmp278_];
3715
3565
_chess_piece_unref0 (rook);
3717
_tmp301_ = old_white_mask;
3718
self->priv->piece_masks[COLOR_WHITE] = _tmp301_;
3719
_tmp302_ = self->priv->piece_masks[COLOR_WHITE];
3720
_tmp303_ = old_black_mask;
3721
self->priv->piece_masks[COLOR_BLACK] = _tmp303_;
3722
_tmp304_ = self->priv->piece_masks[COLOR_BLACK];
3723
_tmp305_ = old_white_can_castle_kingside;
3724
self->can_castle_kingside[COLOR_WHITE] = _tmp305_;
3725
_tmp306_ = self->can_castle_kingside[COLOR_WHITE];
3726
_tmp307_ = old_white_can_castle_queenside;
3727
self->can_castle_queenside[COLOR_WHITE] = _tmp307_;
3728
_tmp308_ = self->can_castle_queenside[COLOR_WHITE];
3729
_tmp309_ = old_black_can_castle_kingside;
3730
self->can_castle_kingside[COLOR_BLACK] = _tmp309_;
3731
_tmp310_ = self->can_castle_kingside[COLOR_BLACK];
3732
_tmp311_ = old_black_can_castle_queenside;
3733
self->can_castle_queenside[COLOR_BLACK] = _tmp311_;
3734
_tmp312_ = self->can_castle_queenside[COLOR_BLACK];
3735
_tmp313_ = old_en_passant_index;
3736
self->en_passant_index = _tmp313_;
3737
_tmp314_ = old_halfmove_clock;
3738
self->halfmove_clock = _tmp314_;
3567
_tmp280_ = old_white_mask;
3568
self->priv->piece_masks[COLOR_WHITE] = _tmp280_;
3569
_tmp281_ = self->priv->piece_masks[COLOR_WHITE];
3570
_tmp282_ = old_black_mask;
3571
self->priv->piece_masks[COLOR_BLACK] = _tmp282_;
3572
_tmp283_ = self->priv->piece_masks[COLOR_BLACK];
3573
_tmp284_ = old_white_can_castle_kingside;
3574
self->can_castle_kingside[COLOR_WHITE] = _tmp284_;
3575
_tmp285_ = self->can_castle_kingside[COLOR_WHITE];
3576
_tmp286_ = old_white_can_castle_queenside;
3577
self->can_castle_queenside[COLOR_WHITE] = _tmp286_;
3578
_tmp287_ = self->can_castle_queenside[COLOR_WHITE];
3579
_tmp288_ = old_black_can_castle_kingside;
3580
self->can_castle_kingside[COLOR_BLACK] = _tmp288_;
3581
_tmp289_ = self->can_castle_kingside[COLOR_BLACK];
3582
_tmp290_ = old_black_can_castle_queenside;
3583
self->can_castle_queenside[COLOR_BLACK] = _tmp290_;
3584
_tmp291_ = self->can_castle_queenside[COLOR_BLACK];
3585
_tmp292_ = old_en_passant_index;
3586
self->en_passant_index = _tmp292_;
3587
_tmp293_ = old_halfmove_clock;
3588
self->halfmove_clock = _tmp293_;
3739
3589
result = _result_;
3740
3590
_chess_piece_unref0 (victim);
3741
3591
_chess_piece_unref0 (piece);
3745
if (_tmp316_ == COLOR_WHITE) {
3746
ChessPlayer* _tmp317_;
3747
_tmp317_ = self->players[COLOR_BLACK];
3748
_tmp315_ = _tmp317_;
3595
if (_tmp295_ == COLOR_WHITE) {
3596
ChessPlayer* _tmp296_ = NULL;
3597
_tmp296_ = self->players[COLOR_BLACK];
3598
_tmp294_ = _tmp296_;
3750
ChessPlayer* _tmp318_;
3751
_tmp318_ = self->players[COLOR_WHITE];
3752
_tmp315_ = _tmp318_;
3600
ChessPlayer* _tmp297_ = NULL;
3601
_tmp297_ = self->players[COLOR_WHITE];
3602
_tmp294_ = _tmp297_;
3754
_tmp319_ = _tmp315_;
3755
_tmp320_ = _g_object_ref0 (_tmp319_);
3604
_tmp298_ = _g_object_ref0 (_tmp294_);
3756
3605
_g_object_unref0 (self->current_player);
3757
self->current_player = _tmp320_;
3758
_tmp321_ = self->current_player;
3759
_tmp322_ = chess_state_get_check_state (self, _tmp321_);
3760
self->check_state = _tmp322_;
3761
_tmp323_ = chess_move_new ();
3606
self->current_player = _tmp298_;
3607
_tmp299_ = self->current_player;
3608
_tmp300_ = chess_state_get_check_state (self, _tmp299_);
3609
self->check_state = _tmp300_;
3610
_tmp301_ = chess_move_new ();
3762
3611
_chess_move_unref0 (self->last_move);
3763
self->last_move = _tmp323_;
3612
self->last_move = _tmp301_;
3613
_tmp302_ = self->last_move;
3614
_tmp303_ = self->number;
3615
_tmp302_->number = _tmp303_;
3616
_tmp304_ = self->last_move;
3618
_tmp306_ = _chess_piece_ref0 (_tmp305_);
3619
_chess_piece_unref0 (_tmp304_->piece);
3620
_tmp304_->piece = _tmp306_;
3621
_tmp307_ = is_promotion;
3623
ChessMove* _tmp308_ = NULL;
3625
ChessPiece* _tmp310_ = NULL;
3626
ChessPiece* _tmp311_ = NULL;
3627
_tmp308_ = self->last_move;
3629
_tmp310_ = self->board[_tmp309_];
3630
_tmp311_ = _chess_piece_ref0 (_tmp310_);
3631
_chess_piece_unref0 (_tmp308_->promotion_piece);
3632
_tmp308_->promotion_piece = _tmp311_;
3634
_tmp312_ = self->last_move;
3636
_tmp314_ = _chess_piece_ref0 (_tmp313_);
3637
_chess_piece_unref0 (_tmp312_->victim);
3638
_tmp312_->victim = _tmp314_;
3639
_tmp315_ = rook_end;
3640
if (_tmp315_ >= 0) {
3641
ChessMove* _tmp316_ = NULL;
3643
ChessPiece* _tmp318_ = NULL;
3644
ChessPiece* _tmp319_ = NULL;
3645
_tmp316_ = self->last_move;
3646
_tmp317_ = rook_end;
3647
_tmp318_ = self->board[_tmp317_];
3648
_tmp319_ = _chess_piece_ref0 (_tmp318_);
3649
_chess_piece_unref0 (_tmp316_->moved_rook);
3650
_tmp316_->moved_rook = _tmp319_;
3652
_tmp320_ = self->last_move;
3654
_tmp320_->r0 = _tmp321_;
3655
_tmp322_ = self->last_move;
3657
_tmp322_->f0 = _tmp323_;
3764
3658
_tmp324_ = self->last_move;
3765
_tmp325_ = self->number;
3766
_tmp324_->number = _tmp325_;
3660
_tmp324_->r1 = _tmp325_;
3767
3661
_tmp326_ = self->last_move;
3769
_tmp328_ = _chess_piece_ref0 (_tmp327_);
3770
_chess_piece_unref0 (_tmp326_->piece);
3771
_tmp326_->piece = _tmp328_;
3772
_tmp329_ = is_promotion;
3774
ChessMove* _tmp330_;
3776
ChessPiece* _tmp332_;
3777
ChessPiece* _tmp333_;
3778
_tmp330_ = self->last_move;
3780
_tmp332_ = self->board[_tmp331_];
3781
_tmp333_ = _chess_piece_ref0 (_tmp332_);
3782
_chess_piece_unref0 (_tmp330_->promotion_piece);
3783
_tmp330_->promotion_piece = _tmp333_;
3785
_tmp334_ = self->last_move;
3787
_tmp336_ = _chess_piece_ref0 (_tmp335_);
3788
_chess_piece_unref0 (_tmp334_->victim);
3789
_tmp334_->victim = _tmp336_;
3790
_tmp337_ = rook_end;
3791
if (_tmp337_ >= 0) {
3792
ChessMove* _tmp338_;
3794
ChessPiece* _tmp340_;
3795
ChessPiece* _tmp341_;
3796
_tmp338_ = self->last_move;
3797
_tmp339_ = rook_end;
3798
_tmp340_ = self->board[_tmp339_];
3799
_tmp341_ = _chess_piece_ref0 (_tmp340_);
3800
_chess_piece_unref0 (_tmp338_->moved_rook);
3801
_tmp338_->moved_rook = _tmp341_;
3803
_tmp342_ = self->last_move;
3805
_tmp342_->r0 = _tmp343_;
3806
_tmp344_ = self->last_move;
3808
_tmp344_->f0 = _tmp345_;
3809
_tmp346_ = self->last_move;
3811
_tmp346_->r1 = _tmp347_;
3812
_tmp348_ = self->last_move;
3814
_tmp348_->f1 = _tmp349_;
3815
_tmp350_ = self->last_move;
3816
_tmp351_ = ambiguous_rank;
3817
_tmp350_->ambiguous_rank = _tmp351_;
3818
_tmp352_ = self->last_move;
3819
_tmp353_ = ambiguous_file;
3820
_tmp352_->ambiguous_file = _tmp353_;
3821
_tmp354_ = self->last_move;
3822
_tmp355_ = self->check_state;
3823
_tmp354_->check_state = _tmp355_;
3663
_tmp326_->f1 = _tmp327_;
3664
_tmp328_ = self->last_move;
3665
_tmp329_ = ambiguous_rank;
3666
_tmp328_->ambiguous_rank = _tmp329_;
3667
_tmp330_ = self->last_move;
3668
_tmp331_ = ambiguous_file;
3669
_tmp330_->ambiguous_file = _tmp331_;
3670
_tmp332_ = self->last_move;
3671
_tmp333_ = self->check_state;
3672
_tmp332_->check_state = _tmp333_;
3825
3674
_chess_piece_unref0 (victim);
3826
3675
_chess_piece_unref0 (piece);
4319
4142
black_bishop_on_white_square = FALSE;
4320
4143
black_bishop_on_black_square = FALSE;
4148
gboolean _tmp0_ = FALSE;
4152
ChessPiece* p = NULL;
4154
ChessPiece* _tmp4_ = NULL;
4155
ChessPiece* _tmp5_ = NULL;
4156
ChessPiece* _tmp6_ = NULL;
4157
gboolean _tmp7_ = FALSE;
4335
4158
gboolean _tmp8_ = FALSE;
4336
gboolean _tmp9_ = FALSE;
4337
ChessPiece* _tmp10_;
4341
ChessPiece* _tmp18_;
4343
ChessPiece* _tmp25_;
4159
ChessPiece* _tmp9_ = NULL;
4160
PieceType _tmp10_ = 0;
4161
ChessPiece* _tmp15_ = NULL;
4162
PieceType _tmp16_ = 0;
4163
ChessPiece* _tmp22_ = NULL;
4164
PieceType _tmp23_ = 0;
4165
gboolean _tmp33_ = FALSE;
4345
4167
gboolean _tmp36_ = FALSE;
4348
gboolean _tmp40_ = FALSE;
4351
gboolean _tmp44_ = FALSE;
4169
gboolean _tmp39_ = FALSE;
4171
gboolean _tmp42_ = FALSE;
4172
gboolean _tmp43_ = FALSE;
4173
gboolean _tmp45_ = FALSE;
4174
gboolean _tmp46_ = FALSE;
4354
4175
gboolean _tmp48_ = FALSE;
4357
gboolean _tmp52_ = FALSE;
4360
gboolean _tmp56_ = FALSE;
4361
gboolean _tmp57_ = FALSE;
4365
gboolean _tmp63_ = FALSE;
4366
gboolean _tmp64_ = FALSE;
4370
gboolean _tmp70_ = FALSE;
4176
gboolean _tmp49_ = FALSE;
4178
gboolean _tmp53_ = FALSE;
4179
gboolean _tmp54_ = FALSE;
4181
gboolean _tmp58_ = FALSE;
4379
4188
_tmp0_ = FALSE;
4190
if (!(_tmp2_ < 64)) {
4381
if (!(_tmp3_ < 64)) {
4385
_tmp5_ = self->board[_tmp4_];
4386
_tmp6_ = _chess_piece_ref0 (_tmp5_);
4389
if (_tmp7_ == NULL) {
4194
_tmp4_ = self->board[_tmp3_];
4195
_tmp5_ = _chess_piece_ref0 (_tmp4_);
4198
if (_tmp6_ == NULL) {
4390
4199
_chess_piece_unref0 (p);
4394
_tmp11_ = _tmp10_->type;
4395
if (_tmp11_ == PIECE_TYPE_PAWN) {
4398
ChessPiece* _tmp12_;
4401
_tmp13_ = _tmp12_->type;
4402
_tmp9_ = _tmp13_ == PIECE_TYPE_ROOK;
4203
_tmp10_ = _tmp9_->type;
4204
if (_tmp10_ == PIECE_TYPE_PAWN) {
4408
ChessPiece* _tmp15_;
4411
_tmp16_ = _tmp15_->type;
4412
_tmp8_ = _tmp16_ == PIECE_TYPE_QUEEN;
4207
ChessPiece* _tmp11_ = NULL;
4208
PieceType _tmp12_ = 0;
4210
_tmp12_ = _tmp11_->type;
4211
_tmp8_ = _tmp12_ == PIECE_TYPE_ROOK;
4216
ChessPiece* _tmp13_ = NULL;
4217
PieceType _tmp14_ = 0;
4219
_tmp14_ = _tmp13_->type;
4220
_tmp7_ = _tmp14_ == PIECE_TYPE_QUEEN;
4417
4224
_chess_piece_unref0 (p);
4421
_tmp19_ = _tmp18_->type;
4422
if (_tmp19_ == PIECE_TYPE_KNIGHT) {
4423
ChessPiece* _tmp20_;
4427
_tmp21_ = chess_piece_get_color (_tmp20_);
4429
if (_tmp22_ == COLOR_WHITE) {
4431
_tmp23_ = white_knight_count;
4432
white_knight_count = _tmp23_ + 1;
4228
_tmp16_ = _tmp15_->type;
4229
if (_tmp16_ == PIECE_TYPE_KNIGHT) {
4230
ChessPiece* _tmp17_ = NULL;
4234
_tmp18_ = chess_piece_get_color (_tmp17_);
4236
if (_tmp19_ == COLOR_WHITE) {
4238
_tmp20_ = white_knight_count;
4239
white_knight_count = _tmp20_ + 1;
4435
_tmp24_ = black_knight_count;
4436
black_knight_count = _tmp24_ + 1;
4242
_tmp21_ = black_knight_count;
4243
black_knight_count = _tmp21_ + 1;
4440
_tmp26_ = _tmp25_->type;
4441
if (_tmp26_ == PIECE_TYPE_BISHOP) {
4445
ChessPiece* _tmp29_;
4247
_tmp23_ = _tmp22_->type;
4248
if (_tmp23_ == PIECE_TYPE_BISHOP) {
4252
ChessPiece* _tmp26_ = NULL;
4448
4255
color = COLOR_BLACK;
4451
if (((_tmp27_ + (_tmp28_ / 8)) % 2) != 0) {
4258
if (((_tmp24_ + (_tmp25_ / 8)) % 2) != 0) {
4452
4259
color = COLOR_WHITE;
4455
_tmp30_ = chess_piece_get_color (_tmp29_);
4457
if (_tmp31_ == COLOR_WHITE) {
4461
if (_tmp32_ == COLOR_WHITE) {
4262
_tmp27_ = chess_piece_get_color (_tmp26_);
4264
if (_tmp28_ == COLOR_WHITE) {
4268
if (_tmp29_ == COLOR_WHITE) {
4462
4269
white_bishop_on_white_square = TRUE;
4464
4271
white_bishop_on_black_square = TRUE;
4466
_tmp33_ = white_bishop_count;
4467
white_bishop_count = _tmp33_ + 1;
4273
_tmp30_ = white_bishop_count;
4274
white_bishop_count = _tmp30_ + 1;
4472
if (_tmp34_ == COLOR_WHITE) {
4279
if (_tmp31_ == COLOR_WHITE) {
4473
4280
black_bishop_on_white_square = TRUE;
4475
4282
black_bishop_on_black_square = TRUE;
4477
_tmp35_ = black_bishop_count;
4478
black_bishop_count = _tmp35_ + 1;
4284
_tmp32_ = black_bishop_count;
4285
black_bishop_count = _tmp32_ + 1;
4481
_tmp37_ = white_knight_count;
4486
_tmp38_ = black_knight_count;
4487
_tmp36_ = _tmp38_ > 1;
4288
_tmp34_ = white_knight_count;
4293
_tmp35_ = black_knight_count;
4294
_tmp33_ = _tmp35_ > 1;
4298
_chess_piece_unref0 (p);
4301
_tmp37_ = white_bishop_count;
4304
_tmp38_ = white_knight_count;
4305
_tmp36_ = _tmp38_ > 0;
4311
_chess_piece_unref0 (p);
4314
_tmp40_ = black_bishop_count;
4317
_tmp41_ = black_knight_count;
4318
_tmp39_ = _tmp41_ > 0;
4492
4324
_chess_piece_unref0 (p);
4495
_tmp41_ = white_bishop_count;
4498
_tmp42_ = white_knight_count;
4499
_tmp40_ = _tmp42_ > 0;
4327
_tmp43_ = white_bishop_on_white_square;
4506
_chess_piece_unref0 (p);
4509
_tmp45_ = black_bishop_count;
4512
_tmp46_ = black_knight_count;
4513
_tmp44_ = _tmp46_ > 0;
4520
_chess_piece_unref0 (p);
4523
_tmp49_ = white_bishop_on_white_square;
4329
gboolean _tmp44_ = FALSE;
4330
_tmp44_ = white_bishop_on_black_square;
4337
_chess_piece_unref0 (p);
4340
_tmp46_ = black_bishop_on_white_square;
4342
gboolean _tmp47_ = FALSE;
4343
_tmp47_ = black_bishop_on_black_square;
4350
_chess_piece_unref0 (p);
4353
_tmp50_ = white_bishop_count;
4358
_tmp51_ = white_knight_count;
4359
_tmp49_ = _tmp51_ > 0;
4526
_tmp50_ = white_bishop_on_black_square;
4363
_tmp52_ = black_knight_count;
4364
_tmp48_ = _tmp52_ > 0;
4529
4366
_tmp48_ = FALSE;
4534
4370
_chess_piece_unref0 (p);
4537
_tmp53_ = black_bishop_on_white_square;
4373
_tmp55_ = black_bishop_count;
4378
_tmp56_ = black_knight_count;
4379
_tmp54_ = _tmp56_ > 0;
4383
_tmp57_ = white_knight_count;
4384
_tmp53_ = _tmp57_ > 0;
4540
_tmp54_ = black_bishop_on_black_square;
4548
_chess_piece_unref0 (p);
4551
_tmp58_ = white_bishop_count;
4556
_tmp59_ = white_knight_count;
4557
_tmp57_ = _tmp59_ > 0;
4562
_tmp61_ = black_knight_count;
4563
_tmp56_ = _tmp61_ > 0;
4570
_chess_piece_unref0 (p);
4573
_tmp65_ = black_bishop_count;
4578
_tmp66_ = black_knight_count;
4579
_tmp64_ = _tmp66_ > 0;
4584
_tmp68_ = white_knight_count;
4585
_tmp63_ = _tmp68_ > 0;
4592
_chess_piece_unref0 (p);
4595
_tmp71_ = white_bishop_count;
4598
_tmp72_ = black_bishop_count;
4599
_tmp70_ = _tmp72_ > 0;
4605
gboolean _tmp74_ = FALSE;
4608
_tmp75_ = white_bishop_on_white_square;
4611
_tmp76_ = black_bishop_on_black_square;
4390
_chess_piece_unref0 (p);
4393
_tmp59_ = white_bishop_count;
4396
_tmp60_ = black_bishop_count;
4397
_tmp58_ = _tmp60_ > 0;
4402
gboolean _tmp61_ = FALSE;
4403
gboolean _tmp62_ = FALSE;
4404
_tmp62_ = white_bishop_on_white_square;
4406
gboolean _tmp63_ = FALSE;
4407
_tmp63_ = black_bishop_on_black_square;
4619
4414
_chess_piece_unref0 (p);
4622
gboolean _tmp78_ = FALSE;
4625
_tmp79_ = white_bishop_on_black_square;
4628
_tmp80_ = black_bishop_on_white_square;
4417
gboolean _tmp64_ = FALSE;
4418
gboolean _tmp65_ = FALSE;
4419
_tmp65_ = white_bishop_on_black_square;
4421
gboolean _tmp66_ = FALSE;
4422
_tmp66_ = black_bishop_on_white_square;
4636
4429
_chess_piece_unref0 (p);
5679
5444
_tmp2__length1 = moves_length1;
5680
5445
if (_tmp2_ != NULL) {
5450
gboolean _tmp3_ = FALSE;
5691
gint _tmp7__length1;
5692
ChessPlayer* _tmp8_;
5693
ChessPlayer* _tmp9_;
5695
gint _tmp10__length1;
5697
const gchar* _tmp12_;
5698
gboolean _tmp13_ = FALSE;
5454
gchar** _tmp6_ = NULL;
5455
gint _tmp6__length1 = 0;
5456
ChessPlayer* _tmp7_ = NULL;
5457
ChessPlayer* _tmp8_ = NULL;
5458
gchar** _tmp9_ = NULL;
5459
gint _tmp9__length1 = 0;
5461
const gchar* _tmp11_ = NULL;
5462
gboolean _tmp12_ = FALSE;
5705
5468
_tmp3_ = FALSE;
5708
_tmp7__length1 = moves_length1;
5709
if (!(_tmp6_ < _tmp7__length1)) {
5471
_tmp6__length1 = moves_length1;
5472
if (!(_tmp5_ < _tmp6__length1)) {
5712
_tmp8_ = chess_game_get_current_player (self);
5715
_tmp10__length1 = moves_length1;
5717
_tmp12_ = _tmp10_[_tmp11_];
5718
_tmp13_ = chess_game_do_move (self, _tmp9_, _tmp12_, TRUE);
5721
gint _tmp14__length1;
5723
const gchar* _tmp16_;
5725
_tmp14__length1 = moves_length1;
5727
_tmp16_ = _tmp14_[_tmp15_];
5728
g_warning ("chess-game.vala:1286: Invalid move %s", _tmp16_);
5475
_tmp7_ = chess_game_get_current_player (self);
5478
_tmp9__length1 = moves_length1;
5480
_tmp11_ = _tmp9_[_tmp10_];
5481
_tmp12_ = chess_game_do_move (self, _tmp8_, _tmp11_, TRUE);
5483
gchar** _tmp13_ = NULL;
5484
gint _tmp13__length1 = 0;
5486
const gchar* _tmp15_ = NULL;
5488
_tmp13__length1 = moves_length1;
5490
_tmp15_ = _tmp13_[_tmp14_];
5491
g_warning ("chess-game.vala:1332: Invalid move %s", _tmp15_);
5734
_tmp17_ = chess_game_get_white (self);
5736
g_signal_connect (_tmp18_, "do-move", (GCallback) _chess_game_move_cb_chess_player_do_move, self);
5737
_tmp19_ = chess_game_get_white (self);
5739
g_signal_connect (_tmp20_, "do-undo", (GCallback) _chess_game_undo_cb_chess_player_do_undo, self);
5740
_tmp21_ = chess_game_get_white (self);
5742
g_signal_connect (_tmp22_, "do-resign", (GCallback) _chess_game_resign_cb_chess_player_do_resign, self);
5743
_tmp23_ = chess_game_get_white (self);
5745
g_signal_connect (_tmp24_, "do-claim-draw", (GCallback) _chess_game_claim_draw_cb_chess_player_do_claim_draw, self);
5746
_tmp25_ = chess_game_get_black (self);
5748
g_signal_connect (_tmp26_, "do-move", (GCallback) _chess_game_move_cb_chess_player_do_move, self);
5749
_tmp27_ = chess_game_get_black (self);
5751
g_signal_connect (_tmp28_, "do-undo", (GCallback) _chess_game_undo_cb_chess_player_do_undo, self);
5752
_tmp29_ = chess_game_get_black (self);
5754
g_signal_connect (_tmp30_, "do-resign", (GCallback) _chess_game_resign_cb_chess_player_do_resign, self);
5755
_tmp31_ = chess_game_get_black (self);
5757
g_signal_connect (_tmp32_, "do-claim-draw", (GCallback) _chess_game_claim_draw_cb_chess_player_do_claim_draw, self);
5497
_tmp16_ = chess_game_get_white (self);
5499
g_signal_connect_object (_tmp17_, "do-move", (GCallback) _chess_game_move_cb_chess_player_do_move, self, 0);
5500
_tmp18_ = chess_game_get_white (self);
5502
g_signal_connect_object (_tmp19_, "do-undo", (GCallback) _chess_game_undo_cb_chess_player_do_undo, self, 0);
5503
_tmp20_ = chess_game_get_white (self);
5505
g_signal_connect_object (_tmp21_, "do-resign", (GCallback) _chess_game_resign_cb_chess_player_do_resign, self, 0);
5506
_tmp22_ = chess_game_get_white (self);
5508
g_signal_connect_object (_tmp23_, "do-claim-draw", (GCallback) _chess_game_claim_draw_cb_chess_player_do_claim_draw, self, 0);
5509
_tmp24_ = chess_game_get_black (self);
5511
g_signal_connect_object (_tmp25_, "do-move", (GCallback) _chess_game_move_cb_chess_player_do_move, self, 0);
5512
_tmp26_ = chess_game_get_black (self);
5514
g_signal_connect_object (_tmp27_, "do-undo", (GCallback) _chess_game_undo_cb_chess_player_do_undo, self, 0);
5515
_tmp28_ = chess_game_get_black (self);
5517
g_signal_connect_object (_tmp29_, "do-resign", (GCallback) _chess_game_resign_cb_chess_player_do_resign, self, 0);
5518
_tmp30_ = chess_game_get_black (self);
5520
g_signal_connect_object (_tmp31_, "do-claim-draw", (GCallback) _chess_game_claim_draw_cb_chess_player_do_claim_draw, self, 0);
6378
static void value_chess_game_init (GValue* value) {
6379
value->data[0].v_pointer = NULL;
6383
static void value_chess_game_free_value (GValue* value) {
6384
if (value->data[0].v_pointer) {
6385
chess_game_unref (value->data[0].v_pointer);
6390
static void value_chess_game_copy_value (const GValue* src_value, GValue* dest_value) {
6391
if (src_value->data[0].v_pointer) {
6392
dest_value->data[0].v_pointer = chess_game_ref (src_value->data[0].v_pointer);
6394
dest_value->data[0].v_pointer = NULL;
6399
static gpointer value_chess_game_peek_pointer (const GValue* value) {
6400
return value->data[0].v_pointer;
6404
static gchar* value_chess_game_collect_value (GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
6405
if (collect_values[0].v_pointer) {
6407
object = collect_values[0].v_pointer;
6408
if (object->parent_instance.g_class == NULL) {
6409
return g_strconcat ("invalid unclassed object pointer for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
6410
} else if (!g_value_type_compatible (G_TYPE_FROM_INSTANCE (object), G_VALUE_TYPE (value))) {
6411
return g_strconcat ("invalid object type `", g_type_name (G_TYPE_FROM_INSTANCE (object)), "' for value type `", G_VALUE_TYPE_NAME (value), "'", NULL);
6413
value->data[0].v_pointer = chess_game_ref (object);
6415
value->data[0].v_pointer = NULL;
6421
static gchar* value_chess_game_lcopy_value (const GValue* value, guint n_collect_values, GTypeCValue* collect_values, guint collect_flags) {
6422
ChessGame** object_p;
6423
object_p = collect_values[0].v_pointer;
6425
return g_strdup_printf ("value location for `%s' passed as NULL", G_VALUE_TYPE_NAME (value));
6427
if (!value->data[0].v_pointer) {
6429
} else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) {
6430
*object_p = value->data[0].v_pointer;
6432
*object_p = chess_game_ref (value->data[0].v_pointer);
6438
GParamSpec* param_spec_chess_game (const gchar* name, const gchar* nick, const gchar* blurb, GType object_type, GParamFlags flags) {
6439
ParamSpecChessGame* spec;
6440
g_return_val_if_fail (g_type_is_a (object_type, TYPE_CHESS_GAME), NULL);
6441
spec = g_param_spec_internal (G_TYPE_PARAM_OBJECT, name, nick, blurb, flags);
6442
G_PARAM_SPEC (spec)->value_type = object_type;
6443
return G_PARAM_SPEC (spec);
6447
gpointer value_get_chess_game (const GValue* value) {
6448
g_return_val_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_CHESS_GAME), NULL);
6449
return value->data[0].v_pointer;
6453
void value_set_chess_game (GValue* value, gpointer v_object) {
6455
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_CHESS_GAME));
6456
old = value->data[0].v_pointer;
6458
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_CHESS_GAME));
6459
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
6460
value->data[0].v_pointer = v_object;
6461
chess_game_ref (value->data[0].v_pointer);
6463
value->data[0].v_pointer = NULL;
6466
chess_game_unref (old);
6471
void value_take_chess_game (GValue* value, gpointer v_object) {
6473
g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, TYPE_CHESS_GAME));
6474
old = value->data[0].v_pointer;
6476
g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, TYPE_CHESS_GAME));
6477
g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
6478
value->data[0].v_pointer = v_object;
6480
value->data[0].v_pointer = NULL;
6483
chess_game_unref (old);
6488
6260
static void chess_game_class_init (ChessGameClass * klass) {
6489
6261
chess_game_parent_class = g_type_class_peek_parent (klass);
6490
CHESS_GAME_CLASS (klass)->finalize = chess_game_finalize;
6491
6262
g_type_class_add_private (klass, sizeof (ChessGamePrivate));
6492
g_signal_new ("started", TYPE_CHESS_GAME, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
6263
G_OBJECT_CLASS (klass)->get_property = _vala_chess_game_get_property;
6264
G_OBJECT_CLASS (klass)->set_property = _vala_chess_game_set_property;
6265
G_OBJECT_CLASS (klass)->finalize = chess_game_finalize;
6266
g_object_class_install_property (G_OBJECT_CLASS (klass), CHESS_GAME_IS_PAUSED, g_param_spec_boolean ("is-paused", "is-paused", "is-paused", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
6267
g_object_class_install_property (G_OBJECT_CLASS (klass), CHESS_GAME_CURRENT_STATE, param_spec_chess_state ("current-state", "current-state", "current-state", TYPE_CHESS_STATE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
6268
g_object_class_install_property (G_OBJECT_CLASS (klass), CHESS_GAME_WHITE, g_param_spec_object ("white", "white", "white", TYPE_CHESS_PLAYER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
6269
g_object_class_install_property (G_OBJECT_CLASS (klass), CHESS_GAME_BLACK, g_param_spec_object ("black", "black", "black", TYPE_CHESS_PLAYER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
6270
g_object_class_install_property (G_OBJECT_CLASS (klass), CHESS_GAME_CURRENT_PLAYER, g_param_spec_object ("current-player", "current-player", "current-player", TYPE_CHESS_PLAYER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
6271
g_object_class_install_property (G_OBJECT_CLASS (klass), CHESS_GAME_OPPONENT, g_param_spec_object ("opponent", "opponent", "opponent", TYPE_CHESS_PLAYER, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
6272
g_object_class_install_property (G_OBJECT_CLASS (klass), CHESS_GAME_CLOCK, g_param_spec_object ("clock", "clock", "clock", TYPE_CHESS_CLOCK, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE));
6273
g_object_class_install_property (G_OBJECT_CLASS (klass), CHESS_GAME_N_MOVES, g_param_spec_uint ("n-moves", "n-moves", "n-moves", 0, G_MAXUINT, 0U, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
6493
6274
g_signal_new ("turn_started", TYPE_CHESS_GAME, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, TYPE_CHESS_PLAYER);
6494
6275
g_signal_new ("moved", TYPE_CHESS_GAME, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_user_marshal_VOID__CHESS_MOVE, G_TYPE_NONE, 1, TYPE_CHESS_MOVE);
6276
g_signal_new ("paused", TYPE_CHESS_GAME, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
6277
g_signal_new ("unpaused", TYPE_CHESS_GAME, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
6495
6278
g_signal_new ("undo", TYPE_CHESS_GAME, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
6496
6279
g_signal_new ("ended", TYPE_CHESS_GAME, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
6500
6283
static void chess_game_instance_init (ChessGame * self) {
6501
6284
self->priv = CHESS_GAME_GET_PRIVATE (self);
6502
6285
self->priv->hold_count = 0;
6503
self->ref_count = 1;
6286
self->priv->_is_paused = FALSE;
6507
static void chess_game_finalize (ChessGame* obj) {
6290
static void chess_game_finalize (GObject* obj) {
6508
6291
ChessGame * self;
6292
ChessClock* _tmp0_ = NULL;
6510
6293
self = G_TYPE_CHECK_INSTANCE_CAST (obj, TYPE_CHESS_GAME, ChessGame);
6511
6294
_tmp0_ = self->priv->_clock;
6512
6295
if (_tmp0_ != NULL) {
6296
ChessClock* _tmp1_ = NULL;
6514
6297
_tmp1_ = self->priv->_clock;
6515
6298
chess_clock_stop (_tmp1_);
6517
6300
__g_list_free__chess_state_unref0_0 (self->move_stack);
6518
6301
_g_object_unref0 (self->priv->_clock);
6302
G_OBJECT_CLASS (chess_game_parent_class)->finalize (obj);
6522
6306
GType chess_game_get_type (void) {
6523
6307
static volatile gsize chess_game_type_id__volatile = 0;
6524
6308
if (g_once_init_enter (&chess_game_type_id__volatile)) {
6525
static const GTypeValueTable g_define_type_value_table = { value_chess_game_init, value_chess_game_free_value, value_chess_game_copy_value, value_chess_game_peek_pointer, "p", value_chess_game_collect_value, "p", value_chess_game_lcopy_value };
6526
static const GTypeInfo g_define_type_info = { sizeof (ChessGameClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) chess_game_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ChessGame), 0, (GInstanceInitFunc) chess_game_instance_init, &g_define_type_value_table };
6527
static const GTypeFundamentalInfo g_define_type_fundamental_info = { (G_TYPE_FLAG_CLASSED | G_TYPE_FLAG_INSTANTIATABLE | G_TYPE_FLAG_DERIVABLE | G_TYPE_FLAG_DEEP_DERIVABLE) };
6309
static const GTypeInfo g_define_type_info = { sizeof (ChessGameClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) chess_game_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ChessGame), 0, (GInstanceInitFunc) chess_game_instance_init, NULL };
6528
6310
GType chess_game_type_id;
6529
chess_game_type_id = g_type_register_fundamental (g_type_fundamental_next (), "ChessGame", &g_define_type_info, &g_define_type_fundamental_info, 0);
6311
chess_game_type_id = g_type_register_static (G_TYPE_OBJECT, "ChessGame", &g_define_type_info, 0);
6530
6312
g_once_init_leave (&chess_game_type_id__volatile, chess_game_type_id);
6532
6314
return chess_game_type_id__volatile;
6536
gpointer chess_game_ref (gpointer instance) {
6539
g_atomic_int_inc (&self->ref_count);
6318
static void _vala_chess_game_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
6320
self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_CHESS_GAME, ChessGame);
6321
switch (property_id) {
6322
case CHESS_GAME_IS_PAUSED:
6323
g_value_set_boolean (value, chess_game_get_is_paused (self));
6325
case CHESS_GAME_CURRENT_STATE:
6326
value_set_chess_state (value, chess_game_get_current_state (self));
6328
case CHESS_GAME_WHITE:
6329
g_value_set_object (value, chess_game_get_white (self));
6331
case CHESS_GAME_BLACK:
6332
g_value_set_object (value, chess_game_get_black (self));
6334
case CHESS_GAME_CURRENT_PLAYER:
6335
g_value_set_object (value, chess_game_get_current_player (self));
6337
case CHESS_GAME_OPPONENT:
6338
g_value_set_object (value, chess_game_get_opponent (self));
6340
case CHESS_GAME_CLOCK:
6341
g_value_set_object (value, chess_game_get_clock (self));
6343
case CHESS_GAME_N_MOVES:
6344
g_value_set_uint (value, chess_game_get_n_moves (self));
6347
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
6544
void chess_game_unref (gpointer instance) {
6547
if (g_atomic_int_dec_and_test (&self->ref_count)) {
6548
CHESS_GAME_GET_CLASS (self)->finalize (self);
6549
g_type_free_instance ((GTypeInstance *) self);
6353
static void _vala_chess_game_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
6355
self = G_TYPE_CHECK_INSTANCE_CAST (object, TYPE_CHESS_GAME, ChessGame);
6356
switch (property_id) {
6357
case CHESS_GAME_IS_PAUSED:
6358
chess_game_set_is_paused (self, g_value_get_boolean (value));
6360
case CHESS_GAME_CLOCK:
6361
chess_game_set_clock (self, g_value_get_object (value));
6364
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);