#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include "SDL/SDL_ttf.h"
#include "SDL/SDL_mixer.h"


#include "../functions/surfaces.hpp"

#include <sstream>

#ifndef RIDINGHOOD_HPP_
#define RIDINGHOOD_HPP_

const int Down = 0;
const int Left = 1;
const int Right = 2;
const int Up = 3;

const int Width = 31;
const int Height = 47;

const int CandleWidth = 21;
const int CandleHeight = 30;

class ridinghood{

	private:

		//sounds
		Mix_Chunk* StepSound;
		Mix_Chunk* MapSound;
		Mix_Chunk* InventorySound;

		Mix_Chunk* Apple;

		Mix_Chunk* LightOnSound, *LightOffSound, *LightRecharge;

		//Character
		SDL_Surface* SpriteSheet;
		SDL_Rect Frames[ 4 ][ 4 ];
		int Frame;
		int Status;

		int xVel, yVel;
		int Velocity;

		//HEART
		int HP;
		SDL_Surface* HeartSheet;
		SDL_Rect HOffsets[ 2 ];


		//Running energy
		int RunEnergy;
		bool isRunning;

		//MAP
		int mapY;
		bool mapOn;
		SDL_Surface* MapSheet;
		SDL_Surface* MapX;
		SDL_Surface* MapFlowerX;
		SDL_Surface* MapFog;

		//Light
		bool LightOn;
		bool ExtraLightOn;

		//Candle-meter
		SDL_Surface* CandleSheet;
		SDL_Rect CandleOffsets[ 5 ];
		int Candles;
		int CandleMeter;
		int CandleFrame;

		//Flowers
		int Flowers;

		//Apples
		int Apples;

		//Inventory
		SDL_Surface* InventorySheet;
		bool invOn;
		int invX;

		TTF_Font* font;
		SDL_Color textcolor;
		SDL_Color maxcolor;

		int Distance;

	public:

		ridinghood();

		~ridinghood();

		void handle_event( SDL_Event, bool Difficulty );

		SDL_Surface* getSpriteSheet();
		SDL_Rect getFrame();

		int getXVel();
		int getYVel();

		void show_stats( SDL_Surface* &, int, int, SDL_Rect* FlowerCoords, bool* Collected );

		void goRun();
		void goWalk();

		void refresh( bool Difficulty );

		bool isLightOn();
		bool isExtraLightOn();

		int& getCandles();
		int& getFlowers();
		int& getApples();

		int& getHP();

		void NullVel();

};

#endif /* RIDINGHOOD_HPP_ */
