12345678910111213141516171819202122232425262728293031323334353637383940 |
- #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.
- };
|