/***************************************************************************
*                                                                          *
*  Copyright (C) Golaem S.A.  All Rights Reserved.                         *
*                                                                          *
***************************************************************************/

#pragma once

//#include "glmSDKAPI.h"
//#include "limits.h"
#include "glmDeque.h"
#include "glmMemory.h"
#include "glmTrafficPositionInRoadData.h"
#include "glmTrafficRoad.h"
//#include "glmVector3.h"
//#include "glmMap.h"
//#include "glmEntity.h"
//#include "glmTrafficCrossing.h" 
//#include "glmTrafficVehicleProperties.h"
//#include "glmTrafficPositionInRoadData.h"
//#include "glmTrafficPerceptionData.h"
//#include "glmTrafficDetectionData.h"

namespace glm
{
	struct UTurnMode
	{
		enum Value
		{
			FORBIDDEN = 0,
			IF_ONLY_POSSIBLE,
			EVERY_TIME_IT_IS_FASTER
		};
	};

	//-------------------------------------------------------------------------
	// Traffic data used for plannification
	class TrafficPlanningData
	{
		GLM_CLASS_STAT_ID( glm::MemoryStatIds::Simulation);
	public:
		TrafficPlanningData();
		~TrafficPlanningData();

		void planPathTo(TrafficContext& trafficContext, const Entity& entity, const Vector3& targetPosition, int uTurnMode);
		void planARoadToLastPosition(TrafficContext& trafficContext, const Entity& entity, int uTurnMode);
		void clear();

	private:
		float getRoadCost(const Road& desiredRoad, float entityMaxSpeed) const;

	public:
		GlmList<int> _roadIndicesToFollow;
		PositionInRoadData _lastRoadPosition; // when reaching last road index, will choose exact lane and go to this abscissa as "end goal"
		int _uTurnMode;
	};
}
