DesignPattern/21.StatePattern/2.Code/Level.h

79 lines
1.2 KiB
C
Raw Normal View History

2019-11-09 02:41:43 +00:00
#ifndef __LEVEL_H__
#define __LEVEL_H__
#include "GameAccount.h"
class Level
{
public :
Level();
virtual ~Level(){}
2021-10-28 15:15:51 +00:00
// 声明方法
2019-11-09 02:41:43 +00:00
void playCard();
void play();
virtual void doubleScore() = 0;
virtual void changeCards() = 0;
virtual void peekCards() = 0;
2021-10-28 15:15:51 +00:00
// 升级
2019-11-09 02:41:43 +00:00
virtual void upgradeLevel() = 0;
GameAccount* getGameAccount();
void setGameAccount(GameAccount* iGameAccount);
private:
GameAccount* gameAccount;
};
class Primary;
class Secondary;
class Professional;
class Final;
class Primary :public Level
{
public:
Primary();
Primary(Level* level);
Primary(GameAccount* ga);
void doubleScore();
void changeCards();
void peekCards();
2021-10-28 15:15:51 +00:00
// 升级
2019-11-09 02:41:43 +00:00
void upgradeLevel();
};
class Secondary :public Level
{
public:
Secondary();
Secondary(Level* level);
void doubleScore();
void changeCards();
void peekCards();
2021-10-28 15:15:51 +00:00
// 升级
2019-11-09 02:41:43 +00:00
void upgradeLevel();
};
class Professional :public Level
{
public:
Professional();
Professional(Level* level);
void doubleScore();
void changeCards();
void peekCards();
2021-10-28 15:15:51 +00:00
// 升级
2019-11-09 02:41:43 +00:00
void upgradeLevel();
};
class Final :public Level
{
public:
Final();
Final(Level* level);
void doubleScore();
void changeCards();
void peekCards();
2021-10-28 15:15:51 +00:00
// 升级
2019-11-09 02:41:43 +00:00
void upgradeLevel();
};
#endif