Labyrinth
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
ptsleftlabel.hpp
1 //////////////////////////////
2 //
3 // File: swce/ptsleftlabel.hpp
4 // Author: Maciej Kaminski
5 // E-mail: maciej.a.kaminski@gmail.com
6 // Website: maciejkaminski.pl
7 //
8 // File creation date: Oct 30 2012
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 __PTS_LEFT_LABEL
15 #define __PTS_LEFT_LABEL
16 namespace SWCE
17 {
18  //! label informing how many points in point
19  //! build system are left for various character properties
21  {
22  protected:
23  //! character associated with this label
25  public:
26  //! constructor
28  //! set associated character (widget won't work without it)
30  {
31  character=c;
32  }
33  };
34  //end of PtsLeft
35 
36  //! how many points are left for skils
37  class SkillsPtsLeft: public PtsLeft
38  {
39  public:
40  void Refresh()
41  {
42  if (character)
43  {
44  std::stringstream ss;
45  ss<<"Points left:" << (character->GetSkillsPointsLeft());
46  SetText(ss.str());
47  }
48  }
49  };
50  //! how many pts are left for edges
51  class EdgePtsLeft: public PtsLeft
52  {
53  public:
54  void Refresh()
55  {
56  if (character)
57  {
58  std::stringstream ss;
59  ss<<"Points left:" << (character->GetEdgePointsLeft());
60  SetText(ss.str());
61  }
62  }
63  };
64  //! how many points are left for powers
65  class PowerPtsLeft: public PtsLeft
66  {
67  public:
68  void Refresh()
69  {
70  if (character)
71  {
72  std::stringstream ss;
73  ss<<"Powers avail.: " << (character->GetPowerAllowanceLeft());
74  SetText(ss.str());
75  }
76  }
77  };
78  //! how many points are left for attributes
79  class AttributesPtsLeft: public PtsLeft
80  {
81  public:
82  void Refresh()
83  {
84  if (character)
85  {
86  std::stringstream ss;
87  ss<<"Points left:" << (character->GetAttributesPointsLeft());
88  SetText(ss.str());
89  }
90  }
91  };
92  //! how many minor hindrances does the character have
94  {
95  public:
96  void Refresh()
97  {
98  if (character)
99  {
100  std::stringstream ss;
101  ss<<"Minor:" << (character->GetNumMinorHindrances());
102  SetText(ss.str());
103  }
104  }
105  };
106  //! how many major hindrances does the character have
108  {
109  public:
110  void Refresh()
111  {
112  if (character)
113  {
114  std::stringstream ss;
115  ss<<"Major:" << (character->GetNumMajorHindrances());
116  SetText(ss.str());
117  }
118  }
119  };
120 }
121 #endif