ManaPlus
castingeffect.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2011-2019 The ManaPlus Developers
4  * Copyright (C) 2019-2021 Andrei Karas
5  *
6  * This file is part of The ManaPlus Client.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef BEING_CASTINGEFFECT_H
23 #define BEING_CASTINGEFFECT_H
24 
25 #include "being/actor.h"
26 
27 #include "enums/being/actortype.h"
28 
29 #include "localconsts.h"
30 
31 class AnimatedSprite;
32 
33 class CastingEffect final : public Actor
34 {
35  public:
36  CastingEffect(const int skillId,
37  const int skillLevel,
38  const std::string &animation,
39  const int x,
40  const int y,
41  const int range);
42 
44 
45  ~CastingEffect() override final;
46 
48  { return ActorType::Unknown; }
49 
50  void draw(Graphics *const graphics,
51  const int offsetX,
52  const int offsetY) const override final A_NONNULL(2);
53 
55  { return mPixelY - mYDiff; }
56 
57  void update(const int time);
58 
59  bool isTerminated() const;
60 
62  { return 1.0F; }
63 
64  void setAlpha(const float alpha A_UNUSED) override final
65  { }
66 
67  protected:
69  int mRectX;
70  int mRectY;
71  int mRectSize;
74 };
75 
76 #endif // BEING_CASTINGEFFECT_H
ActorType ::T ActorTypeT
Definition: actortype.h:43
Definition: actor.h:42
int mYDiff
Definition: actor.h:141
int mPixelY
Definition: actor.h:134
void update(const int time)
CastingEffect(const int skillId, const int skillLevel, const std::string &animation, const int x, const int y, const int range)
virtual ActorTypeT getType() const
Definition: castingeffect.h:47
AnimatedSprite * mSprite
Definition: castingeffect.h:68
float getAlpha() const
Definition: castingeffect.h:61
bool isTerminated() const
void draw(Graphics *const graphics, const int offsetX, const int offsetY) const
void setAlpha(const float alpha)
Definition: castingeffect.h:64
int getSortPixelY() const
Definition: castingeffect.h:54
#define restrict2
Definition: localconsts.h:166
#define override
Definition: localconsts.h:47
#define A_WARN_UNUSED
Definition: localconsts.h:161
#define A_NONNULL(...)
Definition: localconsts.h:168
#define noexcept2
Definition: localconsts.h:50
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53
#define A_UNUSED
Definition: localconsts.h:160