Pol  Revision:4b29d2b
cliface.h
Go to the documentation of this file.
1 
7 #ifndef CLIFACE_H
8 #define CLIFACE_H
9 
10 #include "../../clib/compilerspecifics.h"
11 #include <vector>
12 namespace Pol
13 {
14 namespace Mobile
15 {
16 class Character;
17 class Attribute;
18 }
19 namespace Core
20 {
21 class Vital;
22 class UOSkill;
23 }
24 
25 namespace Network
26 {
27 class Client;
28 
30 {
31 public:
33 
34  void ( *my_vital_changed )( Client* client, Mobile::Character* me, const Core::Vital* vital );
35  void ( *others_vital_changed )( Client* client, Mobile::Character* him,
36  const Core::Vital* vital );
37 };
38 
40 {
41 public:
43 
44  void ( *my_attr_changed )( Client* client, Mobile::Character* me, const Mobile::Attribute* attr );
45 
47 };
48 
50 {
51 public:
52  virtual ~ClientInterface() {}
53  void register_client( Client* client );
54  void deregister_client( Client* client );
55 
56  static void tell_vital_changed( Mobile::Character* who, const Core::Vital* vital );
57  static void tell_attribute_changed( Mobile::Character* who, const Mobile::Attribute* attr );
58 
59 protected:
60  virtual void Initialize();
61 
62  virtual void bcast_vital_changed( Mobile::Character* who, const Core::Vital* vital ) const = 0;
63 
64  std::vector<ClientVitalUpdaters> vital_updaters;
65  std::vector<ClientAttributeUpdaters> attribute_updaters;
66 
67  std::vector<Client*> clients;
68 
69  friend void send_uo_skill( Client* client, Mobile::Character* me, const Mobile::Attribute* attr );
70 };
71 
73 {
74 public:
75  virtual void Initialize() POL_OVERRIDE;
76 
77 protected:
78  friend class ClientInterface;
79  virtual void bcast_vital_changed( Mobile::Character* who,
80  const Core::Vital* vital ) const POL_OVERRIDE;
81 };
82 }
83 }
84 #endif
#define POL_OVERRIDE
std::vector< ClientVitalUpdaters > vital_updaters
Definition: cliface.h:64
std::vector< Client * > clients
Definition: cliface.h:67
void send_uo_skill(Client *client, Mobile::Character *me, const Mobile::Attribute *attr)
Definition: cliface.cpp:167
std::vector< ClientAttributeUpdaters > attribute_updaters
Definition: cliface.h:65
const Core::UOSkill * pUOSkill
Definition: cliface.h:46
Definition: berror.cpp:12