xoreos  0.0.5
chargenchoices.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef ENGINES_NWN_GUI_CHARGEN_CHARGENCHOICES_H
26 #define ENGINES_NWN_GUI_CHARGEN_CHARGENCHOICES_H
27 
28 #include <vector>
29 #include <list>
30 
31 #include "src/common/types.h"
32 #include "src/common/ustring.h"
33 
34 #include "src/engines/nwn/types.h"
35 
36 namespace Engines {
37 
38 namespace NWN {
39 
40 class Creature;
41 class Module;
42 
43 struct SkillItem {
47  size_t skillID;
52 };
53 
54 struct FeatItem {
62 
63  bool operator < (const FeatItem& f) const {
64  return (name < f.name);
65  }
66  FeatItem();
67 };
68 
70 public:
73 
74  void applyChoices();
75 
76  void reset();
77  void resetPackage();
78  const Creature &getCharacter();
79  void setGender(Gender gender);
80  void setRace(uint32 race);
81  void setPortrait(const Common::UString &portrait);
82  void setClass(uint32 classId);
83  void setAlign(uint8 goodness, uint8 lawfulness);
84  void setAbilities(std::vector<uint8> abilities, std::vector<uint8> racialAbilities);
85  void setPackage(uint8 package);
86  void setSkill(size_t skillIndex, uint8 rank);
87  void setNotUsedSkills(uint8 notUsedSkills);
88  void setFeat(uint32 feat);
89  void setSpellSchool(uint8 spellSchool);
90  void setDomains(uint8 domain1, uint8 domain2);
91  void setSpell(size_t spellLevel, uint16 spell);
92  void setSoundSet(uint32 soundSetID);
93  void useCharacter(Module *module);
94 
95  bool hasFeat(uint32 featId) const;
96  bool hasPrereqFeat(uint32 featId, bool isClassFeat);
97  uint32 getClass() const;
98  uint32 getRace() const;
99  bool getAlign(uint8 &goodness, uint8 &lawfulness) const;
100  uint8 getAbility(Ability ability) const;
101  uint8 getTotalAbility(Ability ability) const;
103  void getFeats(std::vector<uint32> &feats);
104  uint8 getPackage() const;
105  uint8 getSpellSchool() const;
106 
107  void getPrefFeats(std::vector<uint32> &feats);
109  void getPrefSkills(std::vector<uint8> &skills);
110  void getPrefDomains(uint8 &domain1, uint8 &domain2);
111  void getPrefSpells(std::vector<std::vector<uint16> > &spells);
112 
114  void getSkillItems(std::vector<SkillItem> &skills);
115  void getFeatItems(std::list<FeatItem> &feats, uint8 &normalFeats, uint8 &bonusFeats);
116 
117 private:
119  std::vector<std::vector<uint16> > _spells;
120  std::vector<uint32> _normalFeats;
121  std::vector<uint32> _racialFeats;
122  std::vector<uint32> _classFeats;
123  std::vector<uint8> _abilities;
124  std::vector<uint8> _racialAbilities;
125  std::vector<uint8> _skills;
126 
136 
137  void init();
139 };
140 
141 } // End of namespace NWN
142 
143 } // End of namespace Engines
144 
145 #endif // ENGINES_NWN_GUI_CHARGEN_CHARGENCHOICES_H
void setSkill(size_t skillIndex, uint8 rank)
Common::UString icon
void getPrefDomains(uint8 &domain1, uint8 &domain2)
std::vector< std::vector< uint16 > > _spells
Common::UString help
A class holding an UTF-8 string.
Definition: ustring.h:48
bool getAlign(uint8 &goodness, uint8 &lawfulness) const
void setAlign(uint8 goodness, uint8 lawfulness)
std::vector< uint32 > _classFeats
Common::UString description
uint8_t uint8
Definition: types.h:200
const Creature & getCharacter()
void setNotUsedSkills(uint8 notUsedSkills)
Common::UString icon
void setPackage(uint8 package)
Basic Neverwinter Nights type definitions.
void setSoundSet(uint32 soundSetID)
uint8 getTotalAbility(Ability ability) const
std::vector< uint32 > _normalFeats
Common::UString name
uint16_t uint16
Definition: types.h:202
void setClass(uint32 classId)
Common::UString name
uint8 getAbility(Ability ability) const
void getPrefFeats(std::vector< uint32 > &feats)
int8 getAbilityModifier(Ability ability)
bool operator<(const FeatItem &f) const
void getPrefSkills(std::vector< uint8 > &skills)
Low-level type definitions to handle fixed width types portably.
bool hasPrereqFeat(uint32 featId, bool isClassFeat)
void useCharacter(Module *module)
bool hasFeat(uint32 featId) const
void getFeatItems(std::list< FeatItem > &feats, uint8 &normalFeats, uint8 &bonusFeats)
std::vector< uint8 > _abilities
void setSpell(size_t spellLevel, uint16 spell)
Unicode string handling.
void setPortrait(const Common::UString &portrait)
void getPrefSpells(std::vector< std::vector< uint16 > > &spells)
std::vector< uint8 > _racialAbilities
void setGender(Gender gender)
int8_t int8
Definition: types.h:199
uint32_t uint32
Definition: types.h:204
void setDomains(uint8 domain1, uint8 domain2)
std::vector< uint32 > _racialFeats
void setSpellSchool(uint8 spellSchool)
uint8 list
The kind of list the feat belongs to: 0 (general feat), 2 (bonus feat), 1 (both)
std::vector< uint8 > _skills
void setAbilities(std::vector< uint8 > abilities, std::vector< uint8 > racialAbilities)
void getSkillItems(std::vector< SkillItem > &skills)
void getFeats(std::vector< uint32 > &feats)