Labyrinth
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
featureimpl.hpp
1 //////////////////////////////
2 //
3 // File: swrs/featureimpl.hpp
4 // Author: Maciej Kaminski
5 // E-mail: maciej.a.kaminski@gmail.com
6 // Website: maciejkaminski.pl
7 //
8 // File creation date: Feb 16 2013
9 // This file is part of Project Labyrinth
10 // This file is going to be released under terms of GNU GPL in near future
11 //
12 //////////////////////////////
13 
14 #ifndef __SW_FEATURE_IMPL_H_
15 #define __SW_FEATURE_IMPL_H_
16 #include <utility>
17 #include <vector>
18 #include <string>
19 #include <map>
20 //#include <tr1/unordered_map>
21 //#include <tr1/memory>
22 #include "helper/tr1.hpp"
23 #include "swrs/character.hpp"
24 #include <exception>
25 #include "swrs/ifeatureimpl.hpp"
26 namespace SWRS
27 {
28  //! implementation of feature class
30  {
31  private:
32  //! feature name
33  std::string name;
34  //! fluff
35  std::string flavor_text;
36  //! charisma modifier(all features are stacked)
37  int charisma_modifier;
38  //! toughness modifier (all features are stacked)
39  int toughness_modifier;
40  //! pace modifier(all features are stacked)
41  int pace_modifier;
42  //! pace modifier(all features are stacked)
43  int parry_modifier;
44  //! additional points for skills(all features are stacked)
45  int skills_points_modifier;
46  //! additional points for attributes(all features are stacked)
47  int attributes_points_modifier;
48  //! additional points for edges(all features are stacked)
49  int edges_points_modifier;
50  //! additional power allowance(all features are stacked)
51  int power_allowance_modifier;
52  //! additional power points (all features are stacked)
53  int power_points_modifier;
54  //! convenience typedef - generic
55  typedef std::map<std::string,int> StringIntMap;
56  //! what attributes are required at which levels
57  StringIntMap attribute_points_requirements;
58  //! traits modified by this feature
59  StringIntMap trait_mod;
60  protected:
61  //! vector of strings
62  typedef std::vector< std::string > StringVector;
63  //! semantic stuff
65  //! hindrances, that CAN'T be taken with
66  //! this particular feature
68  public:
69  //! default constructor
71  {
72  charisma_modifier=0;
73  toughness_modifier=0;
74  pace_modifier=0;
75  parry_modifier=0;
76  skills_points_modifier=0;
77  attributes_points_modifier=0;
78  edges_points_modifier=0;
79  power_allowance_modifier=0;
80  power_points_modifier=0;
81  }
82  //! if hindrance cannot be taken with this particular feature
83  void SetExcludedHindrance(const std::string & h_name);
84 
85  int SetName(const std::string & name);
86  const std::string & GetName() const;
87  int SetFlavorText(const std::string & flavor_text);
88  const std::string & GetFlavorText() const;
89  int SetCharismaModifier(int);
90  int GetCharisma(IConstCharacter * LowerInChain) const;
91  int SetToughnessModifier(int);
92  int GetToughness(IConstCharacter * LowerInChain) const;
93  int SetParryModifier(int);
94  int GetParry(IConstCharacter * LowerInChain) const;
95  int SetPaceModifier(int);
96  int GetPace(IConstCharacter * LowerInChain) const;
97  int SetPowerPointsModifier(int);
98  int GetPowerPoints(IConstCharacter * LowerInChain)const;
100  int GetPowerAllowance(IConstCharacter * LowerInChain)const;
101  int SetSkillsPointsModifier(int m) ;
102  int GetSkillsPoints(IConstCharacter * LowerInChain) const ;
103  int SetAttributesPointsModifier(int m);
104  int GetAttributesPoints(IConstCharacter * LowerInChain) const;
105  int SetEdgesPointsModifier(int m) ;
106  int GetEdgesPoints(IConstCharacter * LowerInChain) const ;
107  int SetRequiredSkillsPerAttribute(const std::string& attr_name,
108  int i);
109  int GetRequiredSkillsPerAttribute(const std::string& attr_name,
110  IConstCharacter * LowerInChain) const;
111  int SetTraitLevelModifier(const std::string & attr_name,
112  int i);
113  int GetTraitLevelModifier(const std::string & attr_name,
114  IConstCharacter * LowerInChain) const;
115 
116  virtual std::pair<bool,std::string> DoesCharacterMeetRequirements(const ICharacter & c)const;
117  virtual ~FeatureImpl(){}
118 
119  };
120 }
121 #endif