#pragma once
#include "Actors\Actor.h"

class MobileMicrobe : public virtual Actor
{
public:
	MobileMicrobe();
	virtual ~MobileMicrobe();

	virtual void Update(float dt);
	virtual void Render();
	
	virtual void ReceiveMessage(Message *m);

protected:
	static const float LINEAR_VELOCITY_DAMPING_FACTOR;
	static const float EXPONENTIAL_VELOCITY_DAMPING_FACTOR;
	static const float OWN_MOVEMENT_THRESHOLD_VELOCITY;

	Vector2 currentVelocity;

	void respectTheLimits();
	void applyDamping(float dt);
	void applyInertia(float dt);
	void turnToVelocityVector(float dt);

	Vector2 getLastPosition(){return lastPosition;}

	void setIgnoreDampingAndInertia(bool ignore){ignoreDampingAndInertia = ignore;}

private:
	Vector2 lastPosition;
	bool ignoreDampingAndInertia;
};