Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. class GameObject : public sf::Transformable, public sf::Drawable
  2. {
  3. public:
  4. GameObject();
  5. GameObject(const std::string& pName);
  6. virtual ~GameObject();
  7.  
  8. const std::string& getName();
  9. void setName(const std::string& pName);
  10.  
  11. virtual void update(sf::Time& pElapsed);
  12. virtual void draw(sf::RenderTarget& pTarget, sf::RenderStates pStates) const;
  13.  
  14. void updateSprite(sf::Time &pElapsed);
  15. void drawSprite(sf::RenderTarget& pTarget, sf::RenderStates pStates) const;
  16. void loadSprite(const std::string& pName, const std::string& pFile, int pCount = 1, int pSpeed = 30);
  17. void setSprite(const std::string& pName);
  18. Sprite* getSprite();
  19. Sprite* getSpriteByName(const std::string& pName);
  20.  
  21. GameObject* getParent();
  22. void setParent(GameObject* pParent);
  23. std::vector<GameObject*>& getChildren();
  24.  
  25. private:
  26. std::string name;
  27. Sprite* sprite;
  28. std::vector<Sprite*> sprites;
  29. GameObject* parent;
  30. std::vector<GameObject*> children;
  31. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement