本文整理汇总了C++中Spy::getTag方法的典型用法代码示例。如果您正苦于以下问题:C++ Spy::getTag方法的具体用法?C++ Spy::getTag怎么用?C++ Spy::getTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spy
的用法示例。
在下文中一共展示了Spy::getTag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void Level3::contact_level(b2Contact* contact)
{
Spy *spyA = spymanager->getChildByBody(contact->GetFixtureA()->GetBody());
Spy *spyB = spymanager->getChildByBody(contact->GetFixtureB()->GetBody());
if (spyA != nullptr && spyB != nullptr)
{
if (((spyA->getTag() == "dan") && (spyB->getTag() == "goal")))
{
b2JointEdge *joint = spyB->getBody()->GetJointList();
if (joint != nullptr || joint != NULL)
{
b2Joint *joint_e = joint->joint;
for (; joint_e != NULL; joint_e = joint_e->GetNext())
{
if (joint_e->GetUserData() == "pig_rope")
{
spyA->getSprite()->runAction(CallFuncN::create(CC_CALLBACK_0(Level3::doCallback, this, joint_e)));
break;
}
}
}
}
if ((spyB->getTag() == "dan") && (spyA->getTag() == "goal"))
{
b2JointEdge *joint = spyA->getBody()->GetJointList();
if (joint != nullptr || joint != NULL)
{
b2Joint *joint_e = joint->joint;
for (; joint_e != NULL; joint_e = joint_e->GetNext())
{
if (joint_e->GetUserData() == "pig_rope")
{
spyB->getSprite()->runAction(CallFuncN::create(CC_CALLBACK_0(Level3::doCallback, this, joint_e)));
break;
}
}
}
}
}
}