Пример #1
0
// Show a dealer chat message for community cards
void ShowCommunityCardMessage(Player* pCommunity)
{
#ifdef PCLIENT_MODULE_
  CChatView* pChat = CChatView::Instance();
  if (pChat)
  {
    CString s;
    // Add a message to the chat window
    if (pCommunity->numCards() == 3)
    { // Flop was dealt
      CString s1, s2, s3;
      Card c1, c2, c3;
      pCommunity->getCard(0, c1);
      pCommunity->getCard(1, c2);
      pCommunity->getCard(2, c3);

      s1 = AsString(c1);
      s2 = AsString(c2);
      s3 = AsString(c3);
      s.Format("Flop is %s, %s, %s",
               (LPCTSTR)s1, (LPCTSTR)s2, (LPCTSTR)s3);
    }
    else if (pCommunity->numCards() == 4)
    {
      CString s1;
      Card c;
      pCommunity->getCard(3, c);
  
      s1 = AsString(c);
      s.Format("Turn is %s", (LPCTSTR)s1);
    }
    else if (pCommunity->numCards() == 5)
    {
      CString s1;
      Card c;
      pCommunity->getCard(4, c);
  
      s1 = AsString(c);
      s.Format("River is %s", (LPCTSTR)s1);
    }
    if (!s.IsEmpty())
    {
      pChat->addDealerMessage(s, CChatView::CF_GameNormal);
    }
  }
#endif
}