void Poke::NewRound() { _m_nBanker = 0; _smallBlinder = 0; _bigBlinder = 0; _totalChips = 0; _baseChips = 0; _callChips = 0; _finishNum = 0; ShuffleCards(); }
void DisplayCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { SetCurrent(); static bool OneTime = false; if(OneTime == false) { LoadAllImages(); ShuffleCards(); OneTime = true; } glClearColor(0.0f,0.5f,0.4f,0); glClear(GL_COLOR_BUFFER_BIT); //DrawTriangle(); Render(); glFlush(); SwapBuffers(); }
bool Initialize(hPtr& deck, hPtr& player1Hand, hPtr& player2Hand, hPtr& player3Hand, hPtr& player4Hand) { deck->list = CreateNodes(kDeckSize); player1Hand->list = (cPtr)malloc(sizeof(_c)); player1Hand->list->suit = -1;//if Length() is called and it returns 1, this can be used to test if it's 1 actual node, or just the initial allocated node with garbage values player1Hand->list->next = NULL; player2Hand->list = (cPtr)malloc(sizeof(_c)); player2Hand->list->suit = -1;//same as above player2Hand->list->next = NULL; player3Hand->list = (cPtr)malloc(sizeof(_c)); player3Hand->list->suit = -1;//same as above player3Hand->list->next = NULL; player4Hand->list = (cPtr)malloc(sizeof(_c)); player4Hand->list->suit = -1;//same as above player4Hand->list->next = NULL; ShuffleCards(deck->list); DealCards(deck->list, player1Hand->list, kHandSize); DealCards(deck->list, player2Hand->list, kHandSize); DealCards(deck->list, player3Hand->list, kHandSize); DealCards(deck->list, player4Hand->list, kHandSize); if(Length(deck->list) == kDeckSize - (4 * kHandSize)) { if(Length(player1Hand->list) == kHandSize) { if(Length(player2Hand->list) == kHandSize) { if(Length(player3Hand->list) == kHandSize) { if(Length(player4Hand->list) == kHandSize) { return true; } } } } } return false; }
void DisplayCanvas::OnKeyPress(wxKeyEvent& event) { //wxMessageBox(wxT(" You pressed a key "),wxT("Bravoo ")); int Key = event.GetUnicodeKey(); if(Key == 13) { //wxMessageBox(wxT(" You pressed enter "),wxT(" Ain't that great ??")); ShuffleCards(); Scrambled = true; } else if (Key >= '1' and Key <= '9') { ActiveCard = Key - '1'; //wxMessageBox(wxT("And yo pressed one "),wxT(" that's great ")); } else if(Key == 'f' or Key == 'F') { Flipped = (Flipped ? false : true); } else if(Key == 'u' or Key == 'U') { //wxMessageBox(wxT(" Unscrambling trying now "),wxT(" Tyring tto unscrambe")); if(Scrambled){ //wxMessageBox(wxT(" Unscrambling now "),wxT(" Tyring to unscrambe")); Scrambled = false; Arrange(Card,Image); //wxMessageBox(wxT(" Unscrambling done"),wxT(" done")); } } else if(Key == 'r' or Key == 'R') { BackId = (BackId ? 0 : 1); } switch(event.GetKeyCode()) { case WXK_LEFT: if(ActiveCard<8 && ActiveCard>=0) { tmp=Card[ActiveCard]; Card[ActiveCard]=Card[ActiveCard+1]; Card[ActiveCard+1]=tmp; ActiveCard++; } break; case WXK_RIGHT: if(ActiveCard>0) { tmp=Card[ActiveCard]; Card[ActiveCard]=Card[ActiveCard-1]; Card[ActiveCard-1]=tmp; ActiveCard--; } break; case WXK_UP: ActiveCard = 8; break; case WXK_DOWN: ActiveCard = -1; default: break; } wxPaintEvent Dummy = wxPaintEvent(); OnPaint(Dummy); }