Beispiel #1
0
bool LagomPlayerBase::checkConstructionRestriction(LagomActorFactory* type,const Ogre::Vector2& location)
{
	if(_selectedActorFactory == _actorFactories.end())
		return false;

	if(_constructionRestrictedType && _constructionRestrictedType != type)
		return false;

	if(location.squaredDistance(_constructionRestrictedLocation) > _constructionRestrictedTolerance*_constructionRestrictedTolerance)
		return false;

	float squareCollision = type->CollisionRange + getIntFactory().CollisionRange;
	squareCollision*=squareCollision;

	if(location.squaredLength() < squareCollision)
		return false;

	return true;
}