本文整理汇总了C++中logic::CEntity::emitMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ CEntity::emitMessage方法的具体用法?C++ CEntity::emitMessage怎么用?C++ CEntity::emitMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类logic::CEntity
的用法示例。
在下文中一共展示了CEntity::emitMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
void CSwordSlashController::process(const std::shared_ptr<Logic::IMessage> &message)
{
if((message->getType().compare("TOUCHED") == 0))
{
Logic::CEntity *otherEntity = dynamic_cast<TOUCHED*>(message.get())->getEntidad();
if(otherEntity)
{
if (otherEntity->getTag() == "enemy")
{
if(_damage>0)
{
std::shared_ptr<DAMAGED> m(new DAMAGED());
m->setFloat(_damage);
m->setString(_entity->getType());
otherEntity->emitMessage(m);
std::shared_ptr<PUSH> pushMessage(new PUSH());
pushMessage->setDirection(_direction);
pushMessage->setSpeed(0.5f);
otherEntity->emitMessage(pushMessage, this);
//BaseSubsystems::Log::Debug("ÑAPA: " + std::to_string(_damage));
}
Logic::CEntityFactory::getSingletonPtr()->createEntityByType("ChispaDanhoEnemy",
otherEntity->getCenterPosition(),
_entity->getMap());
}
}
}
} // process
示例2: activateHealZone
void activateHealZone(unsigned int entityID)
{
Logic::CEntity *entity = Logic::CServer::getSingletonPtr()->getMap()->getEntityByID(entityID);
Logic::MActivateHealZone *m = new Logic::MActivateHealZone();
entity->emitMessage(m);
}
示例3: atacarJack
void atacarJack(unsigned int entityID)
{
Logic::CEntity * jack = Logic::CServer::getSingletonPtr()->getMap()->getEntityByID(entityID);
Logic::CEntity* * entidadesColision;
int numColisiones = Physics::CServer::getSingletonPtr()->detectCollisions(jack->getPosition(), 40, entidadesColision);
for(int i = 0; i < numColisiones; ++i)
{
if (!entidadesColision[i]->getTag().compare("enemy"))
{
//Entidad enemiga que atacará a Jack
Logic::CEntity * entidad = entidadesColision[i];
std::stringstream script;
script << "enemyEvent(\"AttackJack\", " << entidad->getEntityID() << ")";
ScriptManager::CServer::getSingletonPtr()->executeScript(script.str().c_str());
Logic::MAttackEntity *message = new Logic::MAttackEntity();
message->setAttack(true);
message->setEntity(jack);
entidad->emitMessage(message);
}
}
}
示例4: empujarCircle
void empujarCircle(unsigned int entityID)
{
Logic::CEntity *entity = Logic::CServer::getSingletonPtr()->getMap()->getEntityByID(entityID);
Logic::MPushEntities *m = new Logic::MPushEntities();
entity->emitMessage(m);
}
示例5: SendMinionCreated
void SendMinionCreated(Logic::CEntity* minionCreated, std::string leaderName)
{
Logic::CEntity* leader = Logic::CServer::getSingletonPtr()->getMap()->getEntityByName(leaderName);
std::shared_ptr<Logic::GET_LOGIC_ENTITY>m(new Logic::GET_LOGIC_ENTITY());
m->setEntity(minionCreated);
leader->emitMessage(m);
}
示例6: shakeCamera
void shakeCamera(Logic::CEntity *entity, float max, float min)
{
Logic::CEntity* cam = entity->getMap()->getEntityByType("Camera");
std::shared_ptr<Logic::SHAKE> m(new Logic::SHAKE());
m->setMaxShake(max);
m->setMinShake(min);
cam->emitMessage(m);
}
示例7: cancelCure
void cancelCure(unsigned int entityID)
{
Logic::CEntity *entity = Logic::CServer::getSingletonPtr()->getMap()->getEntityByID(entityID);
Logic::MCureEntity *m = new Logic::MCureEntity();
m->setCure(false);
entity->emitMessage(m);
}
示例8: detenerEnemigosContraEnemigos
void detenerEnemigosContraEnemigos(unsigned int entityID)
{
//Mandamos un mensaje para que salga el icono de aturdido
Logic::MAturdido *message = new Logic::MAturdido();
message->setAturdido(false);
Logic::CEntity *entity = Logic::CServer::getSingletonPtr()->getMap()->getEntityByID(entityID);
if (entity)
entity->emitMessage(message);
}
示例9: launchFlameThrower
void launchFlameThrower(unsigned int entityID, float point_x, float point_y, float point_z)
{
Logic::CEntity *entity = Logic::CServer::getSingletonPtr()->getMap()->getEntityByID(entityID);
Logic::MLanzarLlamas *m = new Logic::MLanzarLlamas();
m->setPosition(Vector2(point_x, point_z));
m->setOrdenLlamas(Logic::OrdenLlamas::lanzarLlamas);
entity->emitMessage(m);
}
示例10: cancelFlameThrower
void cancelFlameThrower(unsigned int entityID)
{
Logic::CEntity *entity = Logic::CServer::getSingletonPtr()->getMap()->getEntityByID(entityID);
Logic::MLanzarLlamas *m = new Logic::MLanzarLlamas();
m->setPosition(Vector2(0, 0));
m->setOrdenLlamas(Logic::OrdenLlamas::ocultarBLamas);
entity->emitMessage(m);
}
示例11: launchPowerShoot
void launchPowerShoot(unsigned int entityID, float point_x, float point_y, float point_z)
{
Logic::CEntity *entity = Logic::CServer::getSingletonPtr()->getMap()->getEntityByID(entityID);
Logic::MDisparosPotentes *m = new Logic::MDisparosPotentes();
m->setPosition(Vector2(point_x, point_z));
m->setOrdenDisparos(Logic::OrdenDisparos::disparar);
entity->emitMessage(m);
}
示例12: cancelPowerShoot
void cancelPowerShoot(unsigned int entityID)
{
Logic::CEntity *entity = Logic::CServer::getSingletonPtr()->getMap()->getEntityByID(entityID);
Logic::MDisparosPotentes *m = new Logic::MDisparosPotentes();
m->setPosition(Vector2(0, 0));
m->setOrdenDisparos(Logic::OrdenDisparos::ocultarCono);
entity->emitMessage(m);
}
示例13: launchGrenade
void launchGrenade(unsigned int entityID, float point_x, float point_y, float point_z)
{
Logic::CEntity *entity = Logic::CServer::getSingletonPtr()->getMap()->getEntityByID(entityID);
Logic::MLanzarGranada *m = new Logic::MLanzarGranada();
//m->setPosition(Vector2(entity->getPosition().x, entity->getPosition().y));
m->setPosition(Vector2(point_x, point_z));
m->setOrdenGranada(Logic::OrdenGranada::lanzar);
entity->emitMessage(m);
}
示例14: startCure
void startCure(unsigned int entityID, unsigned int entityIDTarget)
{
Logic::CEntity *entity = Logic::CServer::getSingletonPtr()->getMap()->getEntityByID(entityID);
Logic::CEntity *entityTarget = Logic::CServer::getSingletonPtr()->getMap()->getEntityByID(entityIDTarget);
Logic::MCureEntity *m = new Logic::MCureEntity();
m->setEntity(entityTarget);
m->setCure(true);
entity->emitMessage(m);
}
示例15: damaged
void CCameraFeedbackNotifier::damaged(Vector3 vEnemyPosition) {
std::shared_ptr<Logic::CMessageCameraOffset> m3 = std::make_shared<Logic::CMessageCameraOffset>();
m3->setOffsetTimer(100.0f);//Timer
Logic::CEntity * camera = Logic::CServer::getSingletonPtr()->getMap()->getEntityByName("Camera");
assert(camera != NULL && "Error: Esto no se puede hacer asi que sois unos lamers, ahora el servidor que hace?");
camera->emitMessage(m3);
_scene->setCompositorVisible(_effect, true);
_effectIsActivated = true;
_timestamp = 0;
calculateEnemyPosition(vEnemyPosition);
}// damaged