> For the complete documentation index, see [llms.txt](https://redboard.gitbook.io/r-type-1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://redboard.gitbook.io/r-type-1/server/forcepod.md).

# ForcePod

The ForcePod class handle all force pod weapons

```cpp
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

```cpp
ForcePod(Room &room, Player &player);
```

###

### Shoot

The shoots methods are used to shoot with each weapons:

```cpp
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

```cpp
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

```cpp
void refresh();
```

### Lvl

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

* lvl 1 : Bombs
* lvl 2 : Rays
* lvl 3: Lasers

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