~swtor-meters-developers/swtor-meters/trunk

« back to all changes in this revision

Viewing changes to include/parser/LogUnit.h

  • Committer: Thomas Lokshall
  • Date: 2012-12-13 14:28:05 UTC
  • Revision ID: thomas.lokshall@gmail.com-20121213142805-h42ikg5ikdr8bc5q
Initial commit for Qt version of the application. Currently only has a GUI with sample data.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/// @file
2
 
/// Defines a source unit.
3
 
 
4
 
#ifndef SWTOR_PARSER_LOGUNIT_H
5
 
#define SWTOR_PARSER_LOGUNIT_H
6
 
 
7
 
#include <string>
8
 
#include <vector>
9
 
 
10
 
#include "parser/LogAbility.h"
11
 
 
12
 
namespace swtor
13
 
{
14
 
    namespace parser
15
 
    {
16
 
        /// Unit type.
17
 
        enum LogUnitType
18
 
        {
19
 
            UNIT_TYPE_PLAYER = 1,
20
 
            UNIT_TYPE_COMPANION = 2,
21
 
            UNIT_TYPE_NPC = 3
22
 
        };
23
 
        /// A source unit.
24
 
        class LogUnit
25
 
        {
26
 
        public:
27
 
            /// Default constructor.
28
 
            /// @param name The unit name.
29
 
            /// @param type The unit type.
30
 
            LogUnit(std::string name, LogUnitType type);
31
 
            /// Default deconstructor.
32
 
            ~LogUnit();
33
 
            /// Gets the unit name.
34
 
            /// @return The unit name.
35
 
            std::string GetName();
36
 
            /// Gets the unit type.
37
 
            /// @return The unit type.
38
 
            LogUnitType GetType();
39
 
            /// Adds a new ability to the vector.
40
 
            /// @param name The ability name.
41
 
            void AddAbility(std::string name);
42
 
            /// Gets all abilities.
43
 
            /// @return Vector containing the used abilities.
44
 
            std::vector<LogAbility*> GetAbilities();
45
 
            /// Gets one ability by ID.
46
 
            /// @param id
47
 
            /// @return The LogAbility if found, NULL otherwise.
48
 
            LogAbility *GetAbilityByID(int id);
49
 
            /// Gets one ability by name.
50
 
            /// @param name The ability name.
51
 
            /// @return The LogAbility if found, NULL otherwise.
52
 
            LogAbility *GetAbilityByName(std::string name);
53
 
            /// Gets the total value from all abilities.
54
 
            /// @param type The hit type.
55
 
            /// @return Integer with the total value of all abilities.
56
 
            int GetTotalValue(LogHitType type);
57
 
            /// Gets the total threat from all abilities.
58
 
            /// @param type The hit type.
59
 
            /// @return Integer with the total threat of all abilities.
60
 
            int GetTotalThreat(LogHitType type);
61
 
        private:
62
 
            std::string m_name; ///< The unit name.
63
 
            LogUnitType m_type; ///< The unit type.
64
 
            std::vector<LogAbility*> m_abilities; ///< Vector containing the used abilities.
65
 
        };
66
 
    }
67
 
}
68
 
 
69
 
#endif