小兵类
555555 360°旋转懵逼
估计运行不了
class soldier {
int blood;//小兵血量
int attack;//小兵攻击力
int speed;//小兵移动速度
int location;//小兵位置
public:
soldier() {
blood = 1000;
attack = 100;
speed = 1;
location = 0;
}
void decreaseblood(int d);//小兵被扣血
void attackscale(hero &h);//小兵攻击英雄
void attacktower(tower &t);//小兵打塔
void move();//小兵移动
};
void soldier::decreaseblood(int d)
{
blood = blood - d;
}
void soldier::attackscale(hero &h)
{
h.blood = h.blood - attack;
}
void soldier::attacktower(tower &t)
{
t.blood = t.blood - attack;
}
void soldier::move()
{
location++;
}