Labyrinth
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
ifeatureimpl.hpp
1 //////////////////////////////
2 //
3 // File: swrs/ifeatureimpl.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_IFEATURE_IMPL_H_
15 #define __SW_IFEATURE_IMPL_H_
16 #include <utility>
17 #include <vector>
18 #include <string>
19 //#include <tr1/unordered_map>
20 //#include <tr1/memory>
21 #include "helper/tr1.hpp"
22 #include "swrs/character.hpp"
23 #include <exception>
24 #include "swrs/ifeatureimpl.hpp"
25 namespace SWRS
26 {
27  //! interface class for all feature implementations
29  {
30  public:
31  //! set name
32  virtual int SetName(const std::string & name)=0;
33  //! get name
34  virtual const std::string & GetName() const=0;
35  //! set flavor text
36  virtual int SetFlavorText(const std::string & flavor_text)=0;
37  //! get flavor text for this particular feature
38  virtual const std::string & GetFlavorText() const=0;
39  //! get charisma modifier
40  virtual int SetCharismaModifier(int)=0;
41  //! get actual charisma
42  virtual int GetCharisma(IConstCharacter * LowerInChain) const=0;
43  //! get tougness modifier
44  virtual int SetToughnessModifier(int)=0;
45  //! get toughness
46  virtual int GetToughness(IConstCharacter * LowerInChain) const=0;
47  //! set parry modifier
48  virtual int SetParryModifier(int)=0;
49  //!get parry
50  virtual int GetParry(IConstCharacter * LowerInChain) const=0;
51  //! get parry modifier
52  virtual int SetPaceModifier(int)=0;
53  //! get actual pace
54  virtual int GetPace(IConstCharacter * LowerInChain) const=0;
55  //! how many power points are granted by this feature
56  virtual int SetPowerPointsModifier(int)=0;
57  //! how many powert points are granted
58  virtual int GetPowerPoints(IConstCharacter * LowerInChain)const=0;
59  //! how this feature affects amount of psy/magical powers allowed
60  virtual int SetPowerAllowanceModifier(int)=0;
61  //! calculate total power allowance
62  virtual int GetPowerAllowance(IConstCharacter * LowerInChain)const=0;
63 
64  //! how many points are added for skills
65  virtual int SetSkillsPointsModifier(int m)=0 ;
66  //! what is total skill points allowance
67  virtual int GetSkillsPoints(IConstCharacter * LowerInChain) const=0 ;
68  //! how many points can be spent additionally on attributes
69  virtual int SetAttributesPointsModifier(int m)=0;
70  //! total attributes points
71  virtual int GetAttributesPoints(IConstCharacter * LowerInChain) const=0;
72  //! how many additional edges can be chosen?
73  virtual int SetEdgesPointsModifier(int m)=0 ;
74  //! total number of edges
75  virtual int GetEdgesPoints(IConstCharacter * LowerInChain) const=0 ;
76  //! How many skills have to be chosen for attribute given
77  virtual
78  int SetRequiredSkillsPerAttribute(const std::string& attr_name, int i) =0;
79  //! How many skills have to be chosen for attribute given - total
80  virtual
81  int GetRequiredSkillsPerAttribute(const std::string& attr_name,
82  IConstCharacter * LowerInChain) const=0;
83  //! does this trait/attribute receive special modifier for this particular feature
84  virtual
85  int SetTraitLevelModifier(const std::string & attr_name,int i) =0;
86  //! total modifier
87  virtual
88  int GetTraitLevelModifier(const std::string & attr_name,
89  IConstCharacter * LowerInChain) const=0;
90  //! does character meet requirements of particular feature?
91  //! first field of result is binary answer (true=yes),
92  //! second is verbalized answer "why not" in case of not
93  virtual std::pair<bool,std::string> DoesCharacterMeetRequirements(const ICharacter & c)const=0;
94  //! a virtual destructor - requirement for a polymorphic class
95  virtual ~IFeatureImpl(){}
96  };
97 }
98 #endif