コード例 #1
0
void Card::moveToStackInitial(Stack* s)
{
  _stack = s;

  Card* top = _stack->topCard();
  if (top != 0 && top->canBeParent(this))
    parent(_stack->topCard());
  else
    parent(0);

  _stack->pushCard(this);
   move(_stack->next_x(), _stack->next_y(), false);
}
コード例 #2
0
void Card::moveToStack(Stack* s, bool autoMoving, bool pushUndo)
{
  if (s == 0 || s == _stack) return;

  if (pushUndo)
    undoAddMove(_stack, s);

  _stack->popCard();
  _stack = s;

  Card* top = _stack->topCard();
  if (top != 0 && top->canBeParent(this))
    parent(_stack->topCard());
  else
    parent(0);

  _stack->pushCard(this);
  move(_stack->next_x(), _stack->next_y(), true);

  if (autoMoving && Option::autoPlay()) autoMove();
}