本文整理汇总了C++中CCard::Flip方法的典型用法代码示例。如果您正苦于以下问题:C++ CCard::Flip方法的具体用法?C++ CCard::Flip怎么用?C++ CCard::Flip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCard
的用法示例。
在下文中一共展示了CCard::Flip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
void CTable::Init()
{
unsigned char i = 0;
win_counter = 0;
BBSetBackground( BACK_C );
this->act_slot = BLOCK;
memset( changed, 0xFF, sizeof( changed ) );
block.RemoveAll();
block.Fill();
for( i = 0; i < 7; i++ )
block.Shuffle();
for( i = 0; i < 7; i++ )
tableau[i].RemoveAll();
for( i = 0; i < 4; i++ )
foundation[i].RemoveAll();
hand.RemoveAll();
wastepile.RemoveAll();
unsigned char filled;
for( filled = 1; filled < 7; filled++ )
{
for( i = filled; i < 7 ; i++ )
{
CCard tmp = block.PopCard();
tableau[i].PushCard( tmp, true );
}
}
for( i = 0; i < 7 ; i++ )
{
CCard tmp = block.PopCard();
tmp.Flip();
tableau[i].PushCard( tmp, true );
}
act_slot = BLOCK;
ChangeSelection( true );
}
示例2: DoAction
void CTable::DoAction()
{
CBuffer buffer;
CCard tmp;
CSlot* fnd = NULL;
CSlot* tab = NULL;
switch( act_slot )
{
case BLOCK :
/* move 3 cards to wastepile */
//check IncreaseSelection and DecreaseSelection
//regarding increaseSelection (all) or (+1)
if( 0 != hand.GetCardsStored() ) return;
buffer.RemoveAll();
if( block.GetCardsStored() != 0 )
{
tmp = block.PopCard();
tmp.Flip();
wastepile.PushCard( tmp );
if( 3 == ShowCards )
{
tmp = block.PopCard();
tmp.Flip();
wastepile.PushCard( tmp );
tmp = block.PopCard();
tmp.Flip();
wastepile.PushCard( tmp );
}
act_slot = WASTEPILE;
}
else
{
if( wastepile.GetCardsStored() )
{
tmp = wastepile.PopCard();
while( tmp.IsValid() )
{
tmp.Flip();
block.PushCard( tmp, true );
tmp = wastepile.PopCard();
}
}
}
changed[ WASTEPILE ] = true;
changed[ BLOCK ] = true;
ChangeSelection( );
return;
case WASTEPILE :
/* put one card to hand */
/* or put back from the hand */
if( hand.GetCardsStored() )
{
if( hand.GetSource() == &wastepile )
{
tmp = hand.PopCard();
wastepile.PushCard( tmp, true );
hand.SetSource( NULL );
}
}
else
{
tmp = wastepile.PopCard();
if( false == tmp.IsValid() ) break;
if( false == hand.PushCard( tmp ) )
{
wastepile.PushCard( tmp, true );
}
hand.SetSource( &wastepile );
}
changed[ WASTEPILE ] = true;
changed[ HAND ] = true;
return;
case FOUNDATION1 :
case FOUNDATION2 :
case FOUNDATION3 :
case FOUNDATION4 : fnd = &foundation[act_slot - FOUNDATION1]; break;
//.........这里部分代码省略.........