#include "Platform_Controller.hpp"
#include <cmath>

Platform_Controller::Platform_Controller(std::string id) : moduleID(id)
{
}

float Platform_Controller::constrainValueSymetric(const float inVal, const float absLimitVal)
{
	float outVal = 0;

	// Protect against user passing negative value
	float limit = std::abs(absLimitVal);

	if(inVal > limit)
	{
		outVal = limit;
	}
	else if(inVal < -limit)
	{
		outVal = -limit;
	}
	else
	{
		outVal = inVal;
	}

	return outVal;
}