ForcePod

The ForcePod class handle all force pod weapons

class ForcePod {
public:
    ForcePod(Room &room, Player &player);
    ~ForcePod() = default;
    void refresh();
    void toggleFront();
    void shootBomb();
    void shootLaser();
    void shootRay();
    void bombCollide(IEntity &other);
    void laserCollide(IEntity &other);
    void rayCollide(IEntity &other);
    void setLvl(u_char lvl);
    u_char getLvl() const;
    std::chrono::system_clock::time_point _lastLaserHit;
    std::chrono::system_clock::time_point _lastRayHit;
private:
    bool _isFront;
    std::chrono::system_clock::time_point _lastBomb;
    std::chrono::system_clock::time_point _lastRay;
    std::chrono::system_clock::time_point _lastLaser;
    u_char lvl = 0;
    std::vector<std::unique_ptr<Bomb>> _bombs;
    std::vector<std::unique_ptr<Laser>> _lasers;
    std::vector<std::unique_ptr<Ray>> _rays;
    Room &_room;
    Player &_player;
};

Constructor

The constrcutor need two parameters:

  • The room in wich the force pod is created

  • The player who own the forcce pod

ForcePod(Room &room, Player &player);

Shoot

The shoots methods are used to shoot with each weapons:

void shootBomb();
void shootLaser();
void shootRay();

Collide

The collides methods are used to check if an entity is colliding with a weapon in this forcepod

void bombCollide(IEntity &other);
void laserCollide(IEntity &other);
void rayCollide(IEntity &other);

Refresh

The refresh method is used to refresh each weapons by colling the refresh function for all of them

void refresh();

Lvl

In this class, weapons are unlock step by step with the level

  • lvl 1 : Bombs

  • lvl 2 : Rays

  • lvl 3: Lasers

void setLvl(u_char lvl);
u_char getLvl() const;

Last updated