#include<iostream>
using namespace std;
class Roleststemento
{
public:
int attack;
int defends;
public:
Roleststemento(int m_attc, int m_defends):attack(m_attc),defends(m_defends){}
};
class gamerole
{
private:
int attack;
int defends;
public:
void init()
{
attack=100;
defends=100;
}
void fight()
{
attack=0;
defends=0;
}
Roleststemento* savestate()
{
return (new Roleststemento(attack,defends));
}
void recover(Roleststemento s)
{
attack = s.attack;
defends = s.defends;
}
void show()
{
cout<<attack<<endl;
cout<<defends<<endl;
}
};
class rolemanger
{
public:
Roleststemento *s;
};
int main()
{
gamerole *lixiaoming = new gamerole();
lixiaoming->init();
lixiaoming->show();
rolemanger *beifen = new rolemanger();
beifen->s = lixiaoming->savestate();
lixiaoming->fight();
lixiaoming->show();
lixiaoming->recover(*beifen->s );
lixiaoming->show();
return 0;
}