备忘录模式
#include<iostream>
using namespace std;
//备忘录模式
//角色状态备忘录类
class RoleStateMemento {
public:
RoleStateMemento(int _vit,int _atk,int _def) {
this->vit = _vit;
this->atk = _atk;
this->def = _def;
}
void SetVitality(int _vit) {
this->vit = _vit;
}
int GetVitality() {
return vit;
}
void SetAttack(int _atk) {
this->atk = _atk;
}
int GetAttack() {
return atk;
}
void SetDefense(int _def