Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/items/StarInstrumentItem.hpp
blob: e21c7624b285f169db2d0fbc26547ac697553302 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once

#include "StarItem.hpp"
#include "StarInstrumentItem.hpp"
#include "StarStatusEffectItem.hpp"
#include "StarEffectSourceItem.hpp"
#include "StarToolUserItem.hpp"
#include "StarActivatableItem.hpp"
#include "StarPointableItem.hpp"

namespace Star {

STAR_CLASS(World);
STAR_CLASS(ToolUserEntity);
STAR_CLASS(InstrumentItem);

class InstrumentItem : public Item,
                       public StatusEffectItem,
                       public EffectSourceItem,
                       public ToolUserItem,
                       public ActivatableItem,
                       public PointableItem {
public:
  InstrumentItem(Json const& config, String const& directory, Json const& data);

  ItemPtr clone() const override;

  List<PersistentStatusEffect> statusEffects() const override;
  StringSet effectSources() const override;

  void update(float dt, FireMode fireMode, bool shifting, HashSet<MoveControlType> const& moves) override;

  bool active() const override;
  void setActive(bool active) override;
  bool usable() const override;
  void activate() override;

  List<Drawable> drawables() const override;
  float getAngle(float angle) override;

private:
  List<PersistentStatusEffect> m_activeStatusEffects;
  List<PersistentStatusEffect> m_inactiveStatusEffects;
  StringSet m_activeEffectSources;
  StringSet m_inactiveEffectSources;
  List<Drawable> m_drawables;
  List<Drawable> m_activeDrawables;
  int m_activeCooldown;

  float m_activeAngle;
  String m_kind;
};

}