Planeshift
clientvitals.h
Go to the documentation of this file.
1 /*
2  * clientvitals.h
3  *
4  * Copyright (C) 2005 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program 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 (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef CLIENT_VITALS_HEADER
21 #define CLIENT_VITALS_HEADER
22 //=============================================================================
23 // Crystal Space Includes
24 //=============================================================================
25 
26 //=============================================================================
27 // Project Includes
28 //=============================================================================
29 #include "rpgrules/vitals.h"
30 
31 //=============================================================================
32 // Local Includes
33 //=============================================================================
34 
35 class psStatDRMessage;
36 
38 struct Vital
39 {
40  Vital() : value(0.0), drRate(0.0) {}
41 
42  float value;
43  float drRate;
44 };
45 
50 class psClientVitals : public psVitalManager<Vital>
51 {
52 public:
54 
62  void HandleDRData(psStatDRMessage& msg, const char *labelname );
63 
69  void HandleDeath( const char *labelname );
70 
79  void Predict( csTicks now, const char *labelname );
80 
81 private:
83  unsigned char counter;
84  bool counterSet;
85 };
86 
87 
88 #endif
Manages a set of Vitals and does the predictions and updates on them when new data comes from the ser...
Definition: vitals.h:68
Handles the incoming vital data from the server to update it&#39;s local values.
Definition: clientvitals.h:50
float value
Definition: clientvitals.h:42
float drRate
Definition: clientvitals.h:43
A character vital (such as HP or Mana) - client side.
Definition: clientvitals.h:38