Esempio n. 1
0
void MapAnalysis::Cleanup()
{
    MapGridVector().swap(m_threatGrid);
    MapGridVector().swap(m_attackGrid);
    MapGridVector().swap(m_defenseGrid);
    MapGridVector().swap(m_rangedGrid);
    MapGridVector().swap(m_bombardLandGrid);
    MapGridVector().swap(m_bombardSeaGrid);
    MapGridVector().swap(m_bombardAirGrid);
    MapGridVector().swap(m_valueGrid);
    MapGridVector().swap(m_tradeAtRiskGrid);
    MapGridVector().swap(m_piracyLossGrid);
    BoundingRectVector().swap(m_empireBoundingRect);
    MapPointVector().swap(m_empireCenter);
    Sint16Vector().swap(m_piracyIncomeMatrix);
    Sint32Vector().swap(m_minCityThreat);
    Sint32Vector().swap(m_maxCityThreat);
    Sint16Vector().swap(m_nuclearWeapons);
    Sint16Vector().swap(m_bioWeapons);
    Sint16Vector().swap(m_nanoWeapons);
    Sint16Vector().swap(m_specialAttackers);
    Sint32Vector().swap(m_continentSize);
    Sint16Vector().swap(m_totalPopulation);
    Sint16Vector().swap(m_landArea);
    Sint32Vector().swap(m_totalTrade);
    Sint32Vector().swap(m_projectedScience);
    DoubleVector().swap(m_productionHandicapRatio);
    DoubleVector().swap(m_goldHandicapRatio);
    DoubleVector().swap(m_scienceHandicapRatio);
    Uint32Vector().swap(m_movementTypeUnion);
    m_cityOnContinent.Cleanup();
    m_armyOnContinent.Cleanup();
}
Esempio n. 2
0
DoubleVector CTreeManager::GetTreeOrigin(const CTreeAddress& oAddress) const
{
	TAssert(oAddress.IsValid());
	if (!oAddress.IsValid())
		return DoubleVector();

	const CChunkTrees* pChunkTrees = GetChunkTrees(oAddress.iTerrain, oAddress.vecMin);

	TAssert(pChunkTrees);
	if (!pChunkTrees)
		return DoubleVector();

	return pChunkTrees->GetTreeOrigin(oAddress.iTree);
}
Esempio n. 3
0
inline void SymMatrix::allocate(size_t n) {
  _n = n;
  _matrix = std::vector<DoubleVector>(n);
  for ( size_t idx=0 ; idx < n ; idx++ ){
    _matrix[idx] = DoubleVector(idx+1, Zero<Double>());
  }
}
Esempio n. 4
0
bool CStructure::CanAutoCloseMenu() const
{
	CPlayerCharacter* pOwner = GetOwner()->GetPlayerCharacter();

	if (!pOwner)
		return false;

	if (GetOwner()->IsInBlockPlaceMode())
		return true;

	if (GetOwner()->IsInBlockDesignateMode())
		return true;

	if (GetOwner()->IsInConstructionMode())
		return true;

	TVector vecPlayerEyes = pOwner->GetLocalOrigin() + pOwner->EyeHeight() * DoubleVector(pOwner->GetLocalUpVector());
	TVector vecOwnerProjectionPoint = GetLocalOrigin() + GetLocalTransform().TransformVector(GameData().GetCommandMenuRenderOffset());

	Vector vecToPlayerEyes = (vecPlayerEyes - vecOwnerProjectionPoint).GetMeters();
	float flDistanceToPlayerEyes = vecToPlayerEyes.Length();
	Vector vecProjectionDirection = vecToPlayerEyes/flDistanceToPlayerEyes;

	float flViewAngleDot = AngleVector(pOwner->GetViewAngles()).Dot(vecProjectionDirection);

	if (GameData().GetCommandMenu() && (GameData().GetCommandMenu()->WantsToClose() || flDistanceToPlayerEyes > 5 || flViewAngleDot > -0.7))
		return true;

	return false;
}
Esempio n. 5
0
bool CStructure::CanAutoOpenMenu() const
{
	CPlayerCharacter* pOwner = GetOwner()->GetPlayerCharacter();

	if (!pOwner)
		return false;

	if (GetOwner()->IsInBlockPlaceMode())
		return false;

	if (GetOwner()->IsInBlockDesignateMode())
		return false;

	if (GetOwner()->IsInConstructionMode())
		return false;

	TVector vecPlayerEyes = pOwner->GetLocalOrigin() + pOwner->EyeHeight() * DoubleVector(pOwner->GetLocalUpVector());
	TVector vecOwnerProjectionPoint = GetLocalOrigin() + GetLocalTransform().TransformVector(GameData().GetCommandMenuRenderOffset());

	Vector vecToPlayerEyes = (vecPlayerEyes - vecOwnerProjectionPoint).GetMeters();
	float flDistanceToPlayerEyes = vecToPlayerEyes.Length();
	Vector vecProjectionDirection = vecToPlayerEyes/flDistanceToPlayerEyes;

	float flViewAngleDot = AngleVector(pOwner->GetViewAngles()).Dot(vecProjectionDirection);

	CSPPlayer* pPlayerOwner = static_cast<CSPPlayer*>(pOwner->GetControllingPlayer());

	if (!GameData().GetCommandMenu() && flDistanceToPlayerEyes < 4 && flViewAngleDot < -0.8 && !pPlayerOwner->GetActiveCommandMenu())
		return true;

	return false;
}
DoubleVector Pattern::outputsOf( Cluster* cl ) const {
	if ( pinfo.count(cl) != 0 ) {
		return pinfo[cl].outputs;
	} else {
		return DoubleVector();
	}
};
Esempio n. 7
0
DoubleVector CChunkTrees::GetTreeOrigin(size_t iTree) const
{
	TAssert(iTree < m_avecOrigins.size());
	if (iTree >= m_avecOrigins.size())
		return DoubleVector();

	return m_avecOrigins[iTree];
}
Esempio n. 8
0
 std::vector<double> ScheduleYear_Impl::values() const {
   return DoubleVector();
 }
Esempio n. 9
0
 double Curve_Impl::evaluate(double x) const {
   return evaluate(DoubleVector(1u,x));
 }
Esempio n. 10
0
DoubleVector DoubleMatrix4x4::GetTranslation() const
{
	return DoubleVector((double*)&m[3][0]);
}