本文整理汇总了C++中LPENTITY::IsType方法的典型用法代码示例。如果您正苦于以下问题:C++ LPENTITY::IsType方法的具体用法?C++ LPENTITY::IsType怎么用?C++ LPENTITY::IsType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPENTITY
的用法示例。
在下文中一共展示了LPENTITY::IsType方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DecreasePC
void SECTREE::DecreasePC()
{
LPSECTREE_LIST::iterator it_tree = m_neighbor_list.begin();
while (it_tree != m_neighbor_list.end())
{
LPSECTREE tree = *it_tree++;
if (--tree->m_iPCCount <= 0)
{
if (tree->m_iPCCount < 0)
{
sys_err("tree pc count lower than zero (value %d coord %d %d)", tree->m_iPCCount, tree->m_id.coord.x, tree->m_id.coord.y);
tree->m_iPCCount = 0;
}
ENTITY_SET::iterator it_entity = tree->m_set_entity.begin();
while (it_entity != tree->m_set_entity.end())
{
LPENTITY pkEnt = *(it_entity++);
if (pkEnt->IsType(ENTITY_CHARACTER))
{
LPCHARACTER ch = (LPCHARACTER) pkEnt;
ch->StopStateMachine();
}
}
}
}
}
示例2: Destroy
void SECTREE::Destroy()
{
if (!m_set_entity.empty())
{
sys_err("Sectree: entity set not empty!!");
ENTITY_SET::iterator it = m_set_entity.begin();
for ( ; it != m_set_entity.end(); ++it)
{
LPENTITY ent = *it;
if (ent->IsType(ENTITY_CHARACTER))
{
LPCHARACTER ch = (LPCHARACTER) ent;
sys_err("Sectree: destroying character: %s is_pc %d", ch->GetName(), ch->IsPC() ? 1 : 0);
if (ch->GetDesc())
DESC_MANAGER::instance().DestroyDesc(ch->GetDesc());
else
M2_DESTROY_CHARACTER(ch);
}
else if (ent->IsType(ENTITY_ITEM))
{
LPITEM item = (LPITEM) ent;
sys_err("Sectree: destroying Item: %s", item->GetName());
M2_DESTROY_ITEM(item);
}
else
sys_err("Sectree: unknown type: %d", ent->GetType());
}
}
m_set_entity.clear();
if (!isClone && m_pkAttribute)
{
M2_DELETE(m_pkAttribute);
m_pkAttribute = NULL;
}
}
示例3: operator
void operator() (LPENTITY ent)
{
if (true == ent->IsType(ENTITY_CHARACTER))
{
LPCHARACTER ch = static_cast<LPCHARACTER>(ent);
if (false == ch->IsPC())
{
ch->Dead();
}
}
}
示例4: operator
void operator () (LPENTITY ent)
{
// 오브젝트가 아닌 것은 거리를 계산하여 거리가 멀면 추가하지 않는다.
if (!ent->IsType(ENTITY_OBJECT))
if (DISTANCE_APPROX(ent->GetX() - m_me->GetX(), ent->GetY() - m_me->GetY()) > dwViewRange)
return;
// 나를 대상에 추가
m_me->ViewInsert(ent);
// 둘다 캐릭터면
if (ent->IsType(ENTITY_CHARACTER) && m_me->IsType(ENTITY_CHARACTER))
{
LPCHARACTER chMe = (LPCHARACTER) m_me;
LPCHARACTER chEnt = (LPCHARACTER) ent;
// 대상이 NPC면 StateMachine을 킨다.
if (chMe->IsPC() && !chEnt->IsPC() && !chEnt->IsWarp() && !chEnt->IsGoto())
chEnt->StartStateMachine();
}
}
示例5: operator
void operator () (LPENTITY ent)
{
if (ent->IsType(ENTITY_CHARACTER))
{
LPCHARACTER ch = (LPCHARACTER) ent;
if (ch->IsMonster())
{
return;
}
if (sx <= ch->GetX() && ch->GetX() <= ex
&& sy <= ch->GetY() && ch->GetY() <= ey)
{
bIn = true;
}
}
}
示例6: RemoveEntity
void SECTREE::RemoveEntity(LPENTITY pkEnt)
{
ENTITY_SET::iterator it = m_set_entity.find(pkEnt);
if (it == m_set_entity.end()) {
return;
}
m_set_entity.erase(it);
pkEnt->SetSectree(NULL);
if (pkEnt->IsType(ENTITY_CHARACTER))
{
if (((LPCHARACTER) pkEnt)->IsPC())
DecreasePC();
}
}
示例7: operator
void operator()(LPENTITY ent)
{
if (NULL != ent && true == ent->IsType(ENTITY_CHARACTER))
{
LPCHARACTER pChar = static_cast<LPCHARACTER>(ent);
if (true == pChar->IsPC())
{
if (NULL != pChar->GetGuild())
{
if (dwGuildID == pChar->GetGuild()->GetID())
{
pChar->WarpSet(x, y, mapIndex);
}
}
}
}
}
示例8: InsertEntity
bool SECTREE::InsertEntity(LPENTITY pkEnt)
{
LPSECTREE pkCurTree;
if ((pkCurTree = pkEnt->GetSectree()) == this)
return false;
if (m_set_entity.find(pkEnt) != m_set_entity.end()) {
sys_err("entity %p already exist in this sectree!", get_pointer(pkEnt));
return false;
}
if (pkCurTree)
pkCurTree->m_set_entity.erase(pkEnt);
pkEnt->SetSectree(this);
//pkEnt->UpdateSectree();
m_set_entity.insert(pkEnt);
if (pkEnt->IsType(ENTITY_CHARACTER))
{
LPCHARACTER pkChr = (LPCHARACTER) pkEnt;
if (pkChr->IsPC())
{
IncreasePC();
if (pkCurTree)
pkCurTree->DecreasePC();
}
else if (m_iPCCount > 0 && !pkChr->IsWarp() && !pkChr->IsGoto()) // PC가 아니고 이 곳에 PC가 있다면 Idle event를 시작 시킨다.
{
pkChr->StartStateMachine();
}
}
return true;
}
示例9: operator
bool operator () (LPENTITY ent)
{
if (!ent->IsType(ENTITY_CHARACTER))
return false;
LPCHARACTER pkChr = (LPCHARACTER) ent;
if (pkChr->IsBuilding() &&
(pkChr->IsAffectFlag(AFF_BUILDING_CONSTRUCTION_SMALL) ||
pkChr->IsAffectFlag(AFF_BUILDING_CONSTRUCTION_LARGE) ||
pkChr->IsAffectFlag(AFF_BUILDING_UPGRADE)))
{
m_pkChrBuilding = pkChr;
}
if (pkChr->IsNPC())
{
if ( !pkChr->IsMonster() || !m_pkChr->IsAttackMob() || m_pkChr->IsAggressive() )
return false;
}
if (pkChr->IsDead())
return false;
if (pkChr->IsAffectFlag(AFF_EUNHYUNG) ||
pkChr->IsAffectFlag(AFF_INVISIBILITY) ||
pkChr->IsAffectFlag(AFF_REVIVE_INVISIBLE))
return false;
if (pkChr->IsAffectFlag(AFF_TERROR) && m_pkChr->IsImmune(IMMUNE_TERROR) == false ) // 공포 처리
{
if ( pkChr->GetLevel() >= m_pkChr->GetLevel() )
return false;
}
if ( m_pkChr->IsNoAttackShinsu() )
{
if ( pkChr->GetEmpire() == 1 )
return false;
}
if ( m_pkChr->IsNoAttackChunjo() )
{
if ( pkChr->GetEmpire() == 2 )
return false;
}
if ( m_pkChr->IsNoAttackJinno() )
{
if ( pkChr->GetEmpire() == 3 )
return false;
}
int iDistance = DISTANCE_APPROX(m_lx - pkChr->GetX(), m_ly - pkChr->GetY());
if (iDistance < m_iMinDistance && iDistance <= m_iMaxDistance)
{
m_pkChrVictim = pkChr;
m_iMinDistance = iDistance;
}
return true;
}