
#pragma once

#include "MW4.hpp"
#include "Sensor.hpp"
#include "hudcomp.hpp"

namespace MechWarrior4
{
	const int MAX_HUD_WEAPONS = 30;
	class GUIWeaponManager;
	class GUIWeapon;
	class Weapon;

	class HUDWeapon : public HUDComponent
	{
	protected:

		typedef HUDComponent inherited;

		HUDText *name_array[MAX_HUD_WEAPONS];
		HUDText *ammo_text[MAX_HUD_WEAPONS];
		DWORD weaponcolor;
		SlotOf<Weapon *> m_SingleFire;
		int m_SelectedWeaponGroup;
		Scalar m_ReticleRange;

		ChainOf<GUIWeapon *> m_Weapons;

		SlotOf <GUIWeaponManager *>m_WeaponManager;

		HUDText *m_Text[5];
		int m_NumWeapons;
		bool m_CanHit[6];

		void DrawImplementation(void);

	public:
		HUDWeapon();
		~HUDWeapon();
		void SetupWeapons (void);
		virtual void Reset (void);
		void ReticleRange (Stuff::Scalar value)
		{ m_ReticleRange = value; }

		void SingleFire (Weapon *weap);
		void SelectedWeaponGroup (int selected);
		bool CanHit (int id)
		{
			Verify (id>=0);
			Verify (id < 6);
			return m_CanHit[id];
		}

		void WeaponManager (GUIWeaponManager *value);
	};
}

