Labyrinth
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
hindrance.hpp
1 //////////////////////////////
2 //
3 // File: swrs/hindrance.hpp
4 // Author: Maciej Kaminski
5 // E-mail: maciej.a.kaminski@gmail.com
6 // Website: maciejkaminski.pl
7 //
8 // File creation date: Feb 12 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 __HINDRANCE_H__
15 #define __HINDRANCE_H__
16 #include "swrs/feature.hpp"
17 namespace SWRS
18 {
19 
20  //! for major hindrances (GetSeverity)
21  extern const int HINDRANCE_MAJOR;
22  //! for minor hindrances (GetSeverity)
23  extern const int HINDRANCE_MINOR;
24  //! denoting severity of hindrance which can be minor or major
25  extern const int HINDRANCE_VARYING;
26 
27  //! class representing character hindrances [interface]
28  class Hindrance: public Feature
29  {
30  //! is hindrance set as minor or major (in case of ones with varying severity
31  int actual_severity;
32  public:
33  //! default constructor
34  Hindrance(pFeatureImpl impl);
35  //! minor or major (or varying/unset)
36  int GetSeverity() const;
37  //! return hindrance object of given name. if name matches, return this; 0 otherwise
38  const Hindrance * GetHindrance(const std::string & name) const
39  {
40  if (name==GetName())
41  return this;
42  else
43  return 0;
44  }
45  //! some hindrances can be defined as minor or major (don't use this in videogame implementations)
46  bool IsSeverityVarying()const;
47  //! set as major hindrance
48  void SetMajor();
49  //! SWRS::HINDRANCE_MINOR:
50  void SetMinor();
51  };
52 }
53 #endif
54