GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/resources/skill/skillinfo.h Lines: 0 3 0.0 %
Date: 2017-11-29 Branches: 0 4 0.0 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2004-2009  The Mana World Development Team
4
 *  Copyright (C) 2009-2010  The Mana Developers
5
 *  Copyright (C) 2011-2017  The ManaPlus Developers
6
 *
7
 *  This file is part of The ManaPlus Client.
8
 *
9
 *  This program is free software; you can redistribute it and/or modify
10
 *  it under the terms of the GNU General Public License as published by
11
 *  the Free Software Foundation; either version 2 of the License, or
12
 *  any later version.
13
 *
14
 *  This program is distributed in the hope that it will be useful,
15
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 *  GNU General Public License for more details.
18
 *
19
 *  You should have received a copy of the GNU General Public License
20
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
21
 */
22
23
#ifndef GUI_WIDGETS_SKILLINFO_H
24
#define GUI_WIDGETS_SKILLINFO_H
25
26
#include "enums/simpletypes/modifiable.h"
27
#include "enums/simpletypes/visible.h"
28
29
#include "enums/resources/skill/casttype.h"
30
#include "enums/resources/skill/skillowner.h"
31
#include "enums/resources/skill/skilltype.h"
32
33
#include "utils/vector.h"
34
35
#include <string>
36
#include <map>
37
38
#include "localconsts.h"
39
40
struct SkillData;
41
42
class SkillModel;
43
class SkillTab;
44
45
typedef std::map<int, SkillData*> SkillDataMap;
46
typedef SkillDataMap::iterator SkillDataMapIter;
47
typedef SkillDataMap::const_iterator SkillDataMapCIter;
48
49
struct SkillInfo final
50
{
51
    std::string skillLevel;
52
    std::string skillEffect;
53
    std::string useButton;
54
    std::string errorText;
55
    std::string castingAction;
56
    std::string castingRideAction;
57
    std::string castingSkyAction;
58
    std::string castingWaterAction;
59
    SkillDataMap dataMap;
60
    SkillModel *model;
61
    SkillTab *tab;
62
    SkillData *data;
63
    int level;
64
    int customSelectedLevel;
65
    int customOffsetX;
66
    int customOffsetY;
67
    int skillLevelWidth;
68
    unsigned int id;
69
    int range;
70
    int sp;
71
    int duration;
72
    int durationTime;
73
    int cooldown;
74
    int x;
75
    int y;
76
    SkillType::SkillType type;
77
    SkillOwner::Type owner;
78
    CastTypeT customCastType;
79
    Modifiable modifiable;
80
    Visible visible;
81
    Visible alwaysVisible;
82
    bool useTextParameter;
83
84
    SkillInfo();
85
    A_DELETE_COPY(SkillInfo)
86
    ~SkillInfo();
87
88
    void update();
89
90
    SkillData *getData(const int level) const A_WARN_UNUSED;
91
    SkillData *getData1(const int level) const A_WARN_UNUSED;
92
93
    void addData(const int level, SkillData *const data);
94
95
    bool isUsable() const noexcept2 A_WARN_UNUSED
96
    {
97
        return type == SkillType::Attack
98
            || type == SkillType::Self
99
            || type == SkillType::Support;
100
    }
101
102
    std::string toDataStr() const A_WARN_UNUSED;
103
};
104
105
typedef STD_VECTOR<SkillInfo*> SkillList;
106
typedef SkillList::iterator SkillListIter;
107
108
#endif  // GUI_WIDGETS_SKILLINFO_H