Advertisement
varden

wall.hpp

Aug 31st, 2013
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.34 KB | None | 0 0
  1. #ifndef WALL_HPP
  2. #define WALL_HPP
  3.  
  4. #include "bufftype.hpp"
  5.  
  6. //klasa reprezentujaca sciane na planszy. przed stwoerzeniem obiektow tego typu nalezy wczesniej uzyc LoadTexture
  7. class Wall : public Object
  8. {
  9. public:
  10.     //destructible - czy mur jest zniszczalny
  11.     //buff - buff, ktory kryje sie pod murem
  12.     Wall(const sf::Vector2i& pos, bool destructible, const BuffType buff = BuffNone);
  13.     Wall(const Wall& rhs);
  14.     virtual ~Wall();
  15.  
  16.     /* zwraca true, jezeli tekstura zostanie zaladowana. filename - sciezka do pliku z tekstura */
  17.     static bool LoadTexture(const sf::String& fileName);
  18.  
  19.     //akcesory
  20.     const BuffType& GetBuffType() const;
  21.     virtual ObjectType GetType() const;
  22.  
  23.     //funkcje eventow
  24.     virtual void Event1(); //pusty
  25.     virtual void Event2(); //pusty
  26.     //m - mapa, na ktorej bedzie modyfikowana podczas eventu
  27.     virtual void MapEvent1(Map* m); //pusty
  28.     virtual void MapEvent2(Map* m); //pusty
  29.  
  30. private:
  31.     //poniewaz sa stale w klasie, przypisanie obiektow nic nie da. dlatego zabraniamy tego
  32.     Wall& operator=(Wall& rhs) {return *this;}
  33.  
  34.     virtual void SetSprite(); //ustawia odpowiedni sprite
  35.     virtual void draw(sf::RenderTarget &target, sf::RenderStates states) const;
  36.  
  37.     static sf::Texture myTexture;
  38.  
  39.     const BuffType myBuffType; //buff, jaki kryje pod soba dana sciana
  40. };
  41.  
  42. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement