/*
	Lan Wars.
	Copyright (c) 2009, Darragh Coy.
	All rights reserved.
	Original work(s), source code & author(s) details available at: http://www.darraghcoy.com

	Redistribution and use in source and binary forms, with or without modification, are permitted 
	provided that the following conditions are met:

		* 	Redistributions of source code must retain the above copyright notice, this list of 
			conditions and the following disclaimer.
		* 	Redistributions in binary form must reproduce the above copyright notice, this list of 
			conditions and the following disclaimer in the documentation.
		* 	Neither the name of the author nor the names of contributors may be used to endorse or 
			promote products derived from this software without specific prior written permission.
		* 	The use of any third party libraries, modules or data files provided with the source 
			form of the program must follow and respect the individual licensing terms of these 
			components. You do not have permission to modify or circumvent the licensing terms for 
			provided third party components unless the third party licenses specifically allow this. 
			If you do not agree to the terms of provided third party components then you do not have 
			permission to use them in your derived work(s).
		* 	The terms of this license do not apply to separate (but related) distributions if supplied 
			by the author(s), only to the contents of this source distribution, derived works, and the 
			binaries produced by either modified or unmodified versions of the source code. The terms 
			of this license do not also apply to any third party libraries or components provided with 
			the source distribution. Such third party elements are licensed under their own separate 
			agreements.

	THIS SOFTWARE IS PROVIDED BY DARRAGH COY ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 
	BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
	ARE DISCLAIMED. IN NO EVENT SHALL DARRAGH COY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
	EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 
	OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 
	OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
	IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef GAME_SPRITE_BANK_H
#define GAME_SPRITE_BANK_H

//=====================================================================================================================
//=====================================================================================================================

#include "Network/NetworkAddress.h"

//=====================================================================================================================
//=====================================================================================================================

namespace Game
{
	//=================================================================================================================
	//=================================================================================================================
	
	class SpriteAnimation;

	//=================================================================================================================
	/// @brief		This simple class pre-loads all sprites used in the game and stores them here for later quick
	///				access.
	//=================================================================================================================

	class GameSpriteBank : public ReferencedObject
	{
		public:

			//=========================================================================================================
			// Enums
			//=========================================================================================================

				/// Enum representing a sprite in the sprite bank
				
				enum Sprite
				{
					/// The player sprite
				
					SPRITE_PLAYER = 0 , 
					
					/// The enemy sprite
					
					SPRITE_ENEMY = 1 ,

					/// The rocket launcher sprite

					SPRITE_ROCKET_LAUNCHER = 2 , 
					
					/// The rocket sprite
					
					SPRITE_ROCKET = 3 , 
					
					/// The explosion sprite
					
					SPRITE_EXPLOSION = 4 ,
					
					/// The teleport sprite
					
					SPRITE_TELEPORT = 5 ,
					
					/// The rocket ammo box sprite
					
					SPRITE_ROCKETS = 6 ,
					
					/// The health box sprite ,
					
					SPRITE_HEALTH = 7 ,
					
					/// The small teleport sprite
					
					SPRITE_TELEPORT_SMALL = 8 , 
					
					/// The enemy fireball sprite
					
					SPRITE_FIREBALL = 9
				};
				
				/// The number of sprites in the sprite bank
				
				static const unsigned NUM_SPRITES = 10;

			//=========================================================================================================
			// Functions
			//=========================================================================================================
			
				/// Creates the sprite bank
				
				GameSpriteBank();
				
				/// Destroys the sprite bank
				
				~GameSpriteBank();

				/// Returns the requested sprite
				
				const SpriteAnimation & GetSprite( Sprite sprite ) const;

		private:
		
			//=========================================================================================================
			// Variables
			//=========================================================================================================
			
				/// An array holding all of the sprites
				
				std::vector<SpriteAnimation*> m_sprites;
	};
}

#endif
