#ifndef ACTOR_H #define ACTOR_H #include "SFML/Graphics/Sprite.hpp" #include "SFML/Graphics/Texture.hpp" #include "Bullet.h" struct Position { int x; int y; }; class Actor { public: Actor(int x, int y, std::string path); void loadTexture(std::string path); sf::Sprite& getSprite(); Position getPosition(); void move(float deltaX, float deltaY); void moveLeft(); void moveRight(); void shoot(); std::vector& getBullets(); void updateBullets() { for (auto& bullet : bullets) { if(bullet.getStatus()) { bullets.erase(bullets.begin()); } } } protected: sf::Sprite actorSprite; sf::Texture actorTexture; sf::Texture bulletTexture; Position position; unsigned int hp; unsigned int damage; unsigned int firerate; float moving_speed; std::vector bullets; }; #endif //ACTOR_H