/******************************************************************************
*******************************************************************************

	Bubble Fight EX
	relminator
	http://rel.betterwebber.com


	Tentakill class


*******************************************************************************
******************************************************************************/

#include <nds.h>
#include <vector>

#include "EntityContainer.h"
#include "StarFighter.h"
#include "Vector2df32.h"
#include "cearn_atan.h"
#include "Explosion.h"


#ifndef TENTAKILL_H
#define TENTAKILL_H

#define TENTAKILL_MAX_SEGMENTS 8

//------------------------------------------------------------------------------
//	Tentakill Enemy
//------------------------------------------------------------------------------
class Tentakill {

public:
	friend class TentakillContainer;
	
	Tentakill();
	~Tentakill();
	void Update();
	
private:

	s32		x;
	s32		y;
	s32 	Dx;
	s32		Dy;
	s32		Sy;
	int 	Radius;
	s32		Rotation;
	s32		RotDir;
	int		Frame;
	int 	Counter;
	bool	Active;
	int		Hp;
	
	EN_DRAW_MODE DrawMode;

	Vector2df32 Segments[TENTAKILL_MAX_SEGMENTS][4];
	Vector2df32 Segments2[TENTAKILL_MAX_SEGMENTS][4];
	
};

//------------------------------------------------------------------------------
//	Tentakill Container
//------------------------------------------------------------------------------
class TentakillContainer : public EntityContainer
{	

public:

	TentakillContainer();
    ~TentakillContainer();
    void Init( int Palette, glImage* const Sprites );
    virtual void UpdateEntities();
	virtual void DrawEntities();
	virtual bool Collide( StarFighter &Star );
	virtual void KillAllEntities();
	void Spawn(  int _x, int _sy, s32 speed, int _radius, int _rotation );
	
	virtual int NumEntities() 
	{
		return numEntities;
	}
	
private:
	int numEntities;
	
	glImage *Images;
	int ColorTable;
	
	std::vector<Tentakill> Tentakills;
	
	
};

#endif // TENTAKILL_H
