📄 damaged.cpp
字号:
#include "character.h"
#include "Damaged.h"
#include "gametime.h"
#include "util.h"
Damaged::Damaged()
{
m_name = "Damaged";
m_owner = NULL;
}
void Damaged::init ( IEOwner * owner )
{
m_owner = dynamic_cast<Character *> (owner);
m_lastHealth = m_owner->getHealth();
}
bool Damaged::update ()
{
int curHealth = m_owner->getHealth();
if ( curHealth != m_lastHealth )
{
m_lastHealth = curHealth;
return true;
}
else
return false;
}
IEOwner * Damaged::getOwner ()
{
return m_owner;
}
const char * Damaged::getName()
{
return m_name.c_str();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -