/**
 *  one room arena
 *  Copyright (C) 2016 POSITIVE MENTAL ATTITUDE
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, version 3 of the License.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#pragma once

#include <SFML/Graphics.hpp>

using namespace sf;

class Map;

class Player;

class Powerup: public Sprite
{
public:
	Powerup(std::vector<Texture>* textures);
	const int getType() const;
	static const int count = 4;
	enum {
		Haste = 0, Fatman, Steroids, RateOfFire
	};
private:
	int _type;
};

class PowerupManager: public Drawable
{
public:
	PowerupManager(Map* map);
	void registerPlayer(Player* player);
	void deregisterPlayer(Player* player);
	void logic();
	const unsigned getSize() const;
	const Powerup& getPowerup(unsigned i) const;
private:
	Map* _map;
	std::vector<Player*> _ptr;
	std::vector<Powerup> _powerups;
	std::vector<Texture> _decentlyAllocatedTextures;
	void collision();
	virtual void draw(RenderTarget& target, RenderStates states) const; /// Rendering is also decently done.
};
