// Jason Brillante "Damdoshi"
// Hanged Bunny Studio 2014-2015
//
// KoBang!

#ifndef			__KOBANG_HPP__
# define		__KOBANG_HPP__
# include		<SFML/Graphics.hpp>
# include		<SFML/Audio.hpp>
# include		<list>

struct			Point
{
  double		n;
  double		a;
  sf::Color		c;
};

struct			kobang
{
  void			display_struct(Point&, Point&, Point&, Point&, int);
  void			display_map(void);

  sf::SoundBuffer	shot;
  sf::SoundBuffer	get;
  sf::Sound		shots;
  sf::Sound		gets;
  sf::Music		music;

  /// Decoration facon fete foraine
  bool			currentdiscotype(int		i);
  void			rundisco(void);
  void			changediscotype(void);
  int			disco;
  int			cdisco;

  /// Couleur de la forme
  int			randomize;
  int			rcolor;
  int			gcolor;
  int			bcolor;
  void			changecolor(void);

  /// Deformation de la forme
  int			deforming;
  double		coefx;
  double		coefy;
  int			rot;
  void			startdeforming(void);
  void			stopdeforming(void);
  void			deform(void);

  /// Rotation
  double		angle;
  double		speed;
  void			turn_right(void);
  void			turn_left(void);
  void			turn_speed(double);

  /// changement du millieu
  double		eye_size;
  double		eye_asked_size;
  int			eye_counter;
  void			set_eye_size(double		size);
  void			move_eye_size(void);

  typedef void		(kobang::*ptrshape)(void);
  void			round(void);
  void			square(void);
  void			triangle(void);
  static const ptrshape	shape[3];

  sf::RenderWindow	win;
  int			depth[40];

  std::list<sf::Vector2f> bombs;
  void			display_bomb(void);

  int			width;
  int			deepness;

  double		bomberpos;
  double		nextpos;
  int			sens;
  int			down;
  void			display_bomber(void);

  int			heropos;
  int			herolife;
  int			heroshield;
  int			heroscore;
  int			shield_regen;
  int			catch_serie;
  void			display_hero(void);

  int			backtransparency;
  double		struct_limit;
  double		global_speed;
  int			color_var;
  int			bomb_timer;
  double		bomb_delay;
  int			serie;
  int			serie_cnt;

  std::string		msg;
  int			msg_timer;

  void			start(void);
  void			event(void);
  void			act(void);
  void			display(void);

  bool			started;

  void			display_stats(void);
  void			write(const std::string		&str,
			      int			x,
			      int			y,
			      const sf::Color		&c);

  void			leveling(void);

  kobang(void) {}
  ~kobang(void) {}
};

#endif	//		__KOBANG_HPP__

