forked from krojew/evernus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CharacterRepository.h
62 lines (49 loc) · 2.28 KB
/
CharacterRepository.h
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
55
56
57
58
59
60
61
62
/**
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <unordered_set>
#include "Repository.h"
#include "Character.h"
namespace Evernus
{
class CharacterRepository
: public Repository<Character>
{
public:
using Repository::Repository;
virtual ~CharacterRepository() = default;
virtual QString getTableName() const override;
virtual QString getIdColumn() const override;
virtual EntityPtr populate(const QSqlRecord &record) const override;
void create() const;
void updateSkill(Character::IdType id, const QString &skill, int level) const;
void updateStanding(Character::IdType id, const QString &type, double value) const;
void updateBrokersFee(Character::IdType id, const std::optional<double> &buy, const std::optional<double> &sell) const;
void updateReprocessingImplantBonus(Character::IdType id, double value) const;
void updateManufacturingTimeImplantBonus(Character::IdType id, double value) const;
void updateAlphaClone(Character::IdType id, bool flag) const;
bool hasCharacters() const;
std::unordered_set<Character::IdType> fetchAllIds() const;
QString getNameColumn() const;
quint64 getCorporationId(Character::IdType id) const;
QString getName(Character::IdType id) const;
QSqlQuery getEnabledQuery() const;
QString getCreateQuery() const;
private:
virtual QStringList getColumns() const override;
virtual void bindValues(const Character &entity, QSqlQuery &query) const override;
virtual void bindPositionalValues(const Character &entity, QSqlQuery &query) const override;
};
}