Changeset View
Changeset View
Standalone View
Standalone View
patsolve/yukonsolver.cpp
Show First 20 Lines • Show All 386 Lines • ▼ Show 20 Line(s) | 385 | { | |||
---|---|---|---|---|---|
387 | unsigned int k = i; | 387 | unsigned int k = i; | ||
388 | i = O[2] + (O[3] << 4); | 388 | i = O[2] + (O[3] << 4); | ||
389 | k |= i << 8; | 389 | k |= i << 8; | ||
390 | return k; | 390 | return k; | ||
391 | } | 391 | } | ||
392 | 392 | | |||
393 | MoveHint YukonSolver::translateMove( const MOVE &m ) | 393 | MoveHint YukonSolver::translateMove( const MOVE &m ) | ||
394 | { | 394 | { | ||
395 | PatPile *frompile = 0; | 395 | PatPile *frompile = nullptr; | ||
396 | frompile = deal->store[m.from]; | 396 | frompile = deal->store[m.from]; | ||
397 | 397 | | |||
398 | KCard *card = frompile->at( frompile->count() - m.card_index - 1); | 398 | KCard *card = frompile->at( frompile->count() - m.card_index - 1); | ||
399 | 399 | | |||
400 | if ( m.totype == O_Type ) | 400 | if ( m.totype == O_Type ) | ||
401 | { | 401 | { | ||
402 | PatPile *target = 0; | 402 | PatPile *target = nullptr; | ||
403 | PatPile *empty = 0; | 403 | PatPile *empty = nullptr; | ||
404 | for (int i = 0; i < 4; ++i) { | 404 | for (int i = 0; i < 4; ++i) { | ||
405 | KCard *c = deal->target[i]->topCard(); | 405 | KCard *c = deal->target[i]->topCard(); | ||
406 | if (c) { | 406 | if (c) { | ||
407 | if ( c->suit() == card->suit() ) | 407 | if ( c->suit() == card->suit() ) | ||
408 | { | 408 | { | ||
409 | target = deal->target[i]; | 409 | target = deal->target[i]; | ||
410 | break; | 410 | break; | ||
411 | } | 411 | } | ||
Show All 29 Lines |