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

31 lines
497 B
C
Raw Normal View History

2019-11-09 02:41:43 +00:00
#ifndef __GAMEACCOUNT_H__
#define __GAMEACCOUNT_H__
using namespace std;
#include <iostream>
2021-10-28 15:15:51 +00:00
// 前向声明
2019-11-09 02:41:43 +00:00
class Level;
class GameAccount
{
public:
GameAccount();
GameAccount(string iName);
2021-10-30 06:02:27 +00:00
GameAccount(const GameAccount&) = delete;
GameAccount& operator=(const GameAccount&) = delete;
~GameAccount();
2019-11-09 02:41:43 +00:00
string getName();
void win();
void lose();
void playCard();
void setLevel(Level*);
int getScore();
void setScore(int);
private:
Level* level;
int score;
string name;
};
#endif