/*********************************************************************//**
*	\brief Ammo definition.
*	Jednoducha databaze nazvu a indexu naboju
*
*	\author Michal Jirous
*	\date 24.11.2008
*	\file ammo_def.h
**********************************************************************/

#ifndef __AMMO_H__
#define __AMMO_H__

#include <string>


/** @brief Vycet typu naboju. */
enum ammos
{
	NO_AMMO = 0,
	AMMO_9MM,



	AMMO_COUNT
};

unsigned int getAmmoId( std::string name );	/*!< @brief Vraci ID naboje dle jeho jmena. */

/*!< @brief Seznam jmen naboju. */
static const char *ammo_names[AMMO_COUNT] = {	"ammo_no_ammo",
												"ammo_9mm" };

#include "ctrl_var_definition.h"
/*!< @brief Seznam jmen promennych, ktere udavaji maximalni pocet naboju. */
static const char *max_ammos[AMMO_COUNT] = { "",
												vardef::AMMO_9MM_NAME };

#include "ctrl_gamevars.h"

/** @brief Trida typu naboje. */
class AmmoElement
{
protected:
	variable *pLimits;
	unsigned int amount;
public:
	AmmoElement();								/*!< @brief Konstruktor. */
	AmmoElement( unsigned int type );			/*!< @brief Konstruktor s primym nastavenim typu. */
	void setType( unsigned int type );			/*!< @brief Funkce nastavuje typ naboje. */
	void setAmount( unsigned int new_amount );	/*!< @brief Nastaveni mnozstvi naboju. */
	void addAmmo( unsigned int add_amount );	/*!< @brief Prida naboje. */
	void removeAmmo( unsigned int remove_amount );	/*!< @brief Odebere naboje. */
	unsigned int getAmount();						/*!< @brief Zjisti pocet naboju. */
};

#endif
