ch11cplayer.cpp

来自「此例子是学习C++的好东西」· C++ 代码 · 共 32 行

CPP
32
字号
//Program 11-12   Deal the Cards and Inheritance

//File: Ch11Player.cpp

#include <iostream.h>
#include "Ch11Card.h"
#include "Ch11CPlayer.h"



CPlayer::CPlayer()
{
	cout << "\n In the CCPlayer constructor. ";
	cards_in_hand = 0;;

} 

void CPlayer::GetCard(Card newcard)
{
	Hand[cards_in_hand] = newcard;
	++cards_in_hand;

}
void CPlayer::ShowHand()
{
	int i;

	for(i=0; i < cards_in_hand; ++i) Hand[i].ShowCard();

	cards_in_hand = 0; //reset count for next hand
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?