#pragma once
#include "MobileMicrobe.h"
#include "Damageable.h"

#include "Actors\ParticleActor.h"

class Bacterium;

class Macrophage : public MobileMicrobe, public Damageable
{
public:
	Macrophage();
	virtual ~Macrophage();
	virtual void PreDestroy();

	virtual void die();
	virtual void targetBacteriumDied();

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

protected:
	static const float STANDARD_SENSOR_DISTANCE;
	static const float STANDARD_OWN_MOVEMENT_SPEED;
	static const float STANDARD_DRIFT_AWAY_DISTANCE;

private:
	static const float MAX_BASE_HP;
	static const float BASE_DAMAGE;
	static const float ATTACK_DISTANCE;
	static const int NUM_PARTS;
	static const int NUM_Tentacles;
	
	Bacterium *devouringThisBacterium;

	ParticleActor *macrophageParts;
	ParticleActor *attackTentacles;
	
	float lastFrameLifePercentage;
	
	void driftAway();
	void setTargetBacterium();
	void moveToAndAttackTargetBacterium(float dt);
	void spitOutTargetBacterium();
};