#pragma once
#include "Collision.h"

class WorldLevel;
class Player
{
public:

	Player(const Point2f& Position);
	Collision::CollisionRect GetCollisionRect();
	void Update(float elapsedTime, WorldLevel& level);
	void Draw() const;
	
	void SetPosition(Point2f pos) { m_Position = pos; }
	Point2f GetPosition() const { return m_Position; }

	void SetVelocity(Point2f vel) { m_Vel = vel; }
	Point2f GetVelocity() const { return m_Vel; }

	auto GetContactMap(){ return m_ContactMap; }
	void SetContactMap(Collision::CollisionDirection dir, WorldTile* tile) { m_ContactMap[dir] = tile; }

private:
	Point2f m_Position{};
	Point2f m_Size{};

	Point2f m_Vel{};

	std::map<Collision::CollisionDirection, WorldTile*> m_ContactMap{};

	Point2f m_Acc{};
	Point2f m_Gravity{ 0, -9.81f };
	float m_MaxSpeed{ 200 };
	
};
