本文整理汇总了C++中MoverPtr::getTeam方法的典型用法代码示例。如果您正苦于以下问题:C++ MoverPtr::getTeam方法的具体用法?C++ MoverPtr::getTeam怎么用?C++ MoverPtr::getTeam使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MoverPtr
的用法示例。
在下文中一共展示了MoverPtr::getTeam方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: markRadiusSeenToTeams
void Team::markRadiusSeenToTeams(Stuff::Vector3D& location, float radius, bool shrinkForNight)
{
if(radius < 0.0)
radius = fireVisualRange;
if(shrinkForNight)
radius -= (radius * 0.25f);
bool didTeam[MAX_TEAMS] = {false, false, false, false, false, false, false, false};
for(size_t i = 0; i < ObjectManager->getNumMovers(); i++)
{
MoverPtr mover = ObjectManager->getMover(i);
if(mover->getTeam() && !didTeam[mover->getTeamId()] && !isFriendly(mover->getTeam()))
{
Stuff::Vector3D result;
result.x = location.x - mover->getPosition().x;
result.y = location.y - mover->getPosition().y;
result.z = 0.0;
float dist = result.GetLength() * metersPerWorldUnit;
if(dist < maxVisualRange)
{
markRadiusSeen(location, radius);
didTeam[mover->getTeamId()] = true;
}
}
}
}
示例2: meetsCriteria
bool TeamSensorSystem::meetsCriteria (GameObjectPtr looker, MoverPtr mover, long contactCriteria) {
bool isSensor[NUM_CONTACT_STATUSES] = {false, true, true, true, true, false};
long status = mover->getContactStatus(teamId, true);
if (mover->getFlag(OBJECT_FLAG_REMOVED))
return(false);
if (status == CONTACT_NONE)
return(false);
if (contactCriteria & CONTACT_CRITERIA_VISUAL_OR_SENSOR)
if ((status != CONTACT_VISUAL) && !isSensor[status])
return(false);
if (contactCriteria & CONTACT_CRITERIA_VISUAL)
if (status != CONTACT_VISUAL)
return(false);
if (contactCriteria & CONTACT_CRITERIA_SENSOR)
if (!isSensor[status])
return(false);
if (contactCriteria & CONTACT_CRITERIA_NOT_CHALLENGED) {
if (mover->getChallenger() != NULL)
return(false);
}
if (contactCriteria & CONTACT_CRITERIA_NOT_DISABLED) {
if (mover->isDisabled())
return(false);
}
if (contactCriteria & CONTACT_CRITERIA_ENEMY) {
if ((teamId == -1) || !mover->getTeam())
return(false);
if (!Team::teams[teamId]->isEnemy(mover->getTeam()))
return(false);
}
if (contactCriteria & CONTACT_CRITERIA_ARMED) {
if (mover->numFunctionalWeapons == 0)
return(false);
}
return(true);
}
示例3: calcContactStatus
long SensorSystem::calcContactStatus (MoverPtr mover) {
if (!owner->getTeam())
return(CONTACT_NONE);
if (mover->getFlag(OBJECT_FLAG_REMOVED)) {
return(CONTACT_NONE);
}
//----------------------------------------------------------
//If object we are looking for is at the edge, NO CONTACT!!
if (!Terrain::IsGameSelectTerrainPosition(mover->getPosition()))
return CONTACT_NONE;
//-------------------------------------------------------------
// Should be properly set when active probes are implemented...
long newContactStatus = CONTACT_NONE;
if (!notShutdown || (range == 0.0) && !broken)
{
if (owner->lineOfSight(mover) && !mover->isDisabled())
newContactStatus = CONTACT_VISUAL;
return(newContactStatus);
}
if ((masterIndex == -1) || (range < 0.0)) {
return(CONTACT_NONE);
}
if (owner->isMover()) {
MoverPtr mover = (MoverPtr)owner;
if ((mover->sensor == 255) || mover->inventory[mover->sensor].disabled || broken) {
return(CONTACT_NONE);
}
}
if (mover->getFlag(OBJECT_FLAG_SENSOR) && !mover->isDisabled())
{
bool moverNotContact = mover->hasNullSignature() || (mover->getEcmRange() != 0.0f);
bool moverInvisible = (mover->getStatus() == OBJECT_STATUS_SHUTDOWN);
if (!moverInvisible && !moverNotContact)
{
float distanceToMover = owner->distanceFrom(mover->getPosition());
float sensorRange = getEffectiveRange();
if (distanceToMover <= sensorRange)
{
//-------------------------------------------
//No need to check shutdown and probe AGAIN!
newContactStatus = getSensorQuality();
//---------------------------------------
// If ecm affecting me, my skill drops...
// CUT, per Mitch 2/10/00
if ((ecmEffect < 1.0) && (newContactStatus > CONTACT_SENSOR_QUALITY_1))
newContactStatus--;
//---------------------------------------------------
// We now we are within sensor range, check visual.
float startRadius = 0.0f;
if (!owner->isMover())
startRadius = owner->getAppearRadius();
if (hasLOSCapability && owner->lineOfSight(mover,startRadius))
newContactStatus = CONTACT_VISUAL;
}
else //Still need to check if visual!!! ECM and Lookout Towers!!
{
float startRadius = 0.0f;
if (!owner->isMover())
startRadius = owner->getAppearRadius();
if (hasLOSCapability && owner->lineOfSight(mover,startRadius))
newContactStatus = CONTACT_VISUAL;
}
}
else
{
//Target is shutdown, can ONLY be visual cause this platform has no probe.
float startRadius = 0.0f;
if (!owner->isMover())
startRadius = owner->getAppearRadius();
if (hasLOSCapability && owner->lineOfSight(mover,startRadius))
newContactStatus = CONTACT_VISUAL;
}
}
//Let us know that we can see something, sensor or otherwise!!
if (mover->getTeam() && (owner->getTeam() == Team::home) && mover->getTeam()->isEnemy(Team::home) &&
(newContactStatus != CONTACT_NONE))
{
SensorSystemManager::enemyInLOS = true;
}
return(newContactStatus);
}