📄 democratfactory.cpp
字号:
// DemocratFactory.cpp: implementation of the DemocratFactory class.
//
//////////////////////////////////////////////////////////////////////
#include "DemocratFactory.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
DemocratFactory::DemocratFactory()
{
}
DemocratFactory::~DemocratFactory()
{
}
Officer* DemocratFactory::CreateOfficer(OfficialType type)
{
Officer *off;
switch(type)
{
case PresidentType:
off=new President("Democrat");
break;
case AttorneyGeneralType:
off=new AttorneyGeneral("Democrat");
break;
case MinorityPartyCongressPersonType:
off=new MinorityPartyCongressPerson("Democrat");
break;
default:
break;
}
m_pProtoType[type]=off->Clone();
if(off!=NULL)
delete off;
return m_pProtoType[type];
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -