
#ifndef BALL_LIST_HH_
#define BALL_LIST_HH_

#include <vector>
#include "../factory/chord.h"
#include "../factory/particle.h"
#include "../factory/surface.h"
#include "../factory/vertex.h"
#include "../map/struct.hh"
#include "ball.h"
#include "pad.hh"

#define BALL_COUNT_ITEM		16
#define BALL_COUNT_SOUND	5
#define BALL_COUNT_TYPE		3

#define BALL_DIST_INACTIVE	5

#define BALL_RAND_LOOT		10

#define BALL_WEIGHT_HEAVY	0.000025f
#define BALL_WEIGHT_LIGHT	0.0f
#define BALL_WEIGHT_NORMAL	0.00001f

struct	s_bonus_list;

typedef std::vector<s_block_group>	t_blockGroup;
typedef std::vector<s_block>		t_block;

enum	e_ball_sound
{
	BALL_SOUND_BLOCK_DESTROY,
	BALL_SOUND_BLOCK_HIT,
	BALL_SOUND_BLOCK_UNBREAKABLE,
	BALL_SOUND_PAD,
	BALL_SOUND_WALL
};

enum	e_ball_state
{
	BALL_STATE_INACTIVE,
	BALL_STATE_ALIVE
};

enum	e_ball_type
{
	BALL_TYPE_HEAVY,
	BALL_TYPE_LIGHT,
	BALL_TYPE_NORMAL
};

struct  s_ball_list
{
	bool				empty;
	struct s_ball		list[BALL_COUNT_ITEM];
	struct s_particle*	particle;
	GLUquadricObj*		quadric;
	unsigned int		sound[BALL_COUNT_SOUND];
	enum e_ball_state	state[BALL_COUNT_ITEM];
	GLuint				texture[BALL_COUNT_TYPE];
	float				x1;
	float				x2;
	float				y1;
	float				y2;
};

void	ball_list_collide (struct s_ball_list*, struct s_pad*, t_blockGroup&, struct s_bonus_list*);
void	ball_list_define (struct s_ball_list*, struct s_particle*, struct s_surface*, GLUquadricObj*, float, float, float, float);
void	ball_list_draw (struct s_ball_list*);
void	ball_list_insert (struct s_ball_list*, float, float);
void	ball_list_loop (struct s_ball_list*);
void	ball_list_move (struct s_ball_list*);
void	ball_list_state (struct s_ball_list*, char);
void	ball_list_type (struct s_ball_list*, enum e_ball_type);

#endif
