effects.h

main 34 lines · 727 bytes Raw
Alex Alex Commit Server upload 18/10/2026 23:38
1#ifndef FS_EFFECTS_H
2#define FS_EFFECTS_H
3
4struct Effect
5{
6 Effect(uint16_t id, uint16_t clientId, std::string name, int32_t speed, bool premium) :
7 name(std::move(name)), speed(speed), clientId(clientId), id(id), premium(premium) {}
8
9 std::string name;
10 int32_t speed;
11 uint16_t clientId;
12 uint16_t id; // Changed from uint8_t to uint16_t
13 bool premium;
14};
15
16class Effects
17{
18 public:
19 bool reload();
20 bool loadFromXml();
21 Effect* getEffectByID(uint16_t id); // Changed from uint8_t to uint16_t
22 Effect* getEffectByName(const std::string& name);
23 Effect* getEffectByClientID(uint16_t clientId);
24
25 const std::vector<Effect>& getEffects() const {
26 return effects;
27 }
28
29 private:
30 std::vector<Effect> effects;
31};
32
33#endif
34
Top