]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ACLIENT_H | |
2 | #define ACLIENT_H | |
3 | ||
4 | #include <string.h> | |
5 | #include "player.h" | |
6 | #include <iostream> | |
7 | using std::ostream; | |
8 | ||
9 | class Player; // forward declaration | |
10 | ||
11 | class aClient { | |
12 | ||
13 | friend ostream &operator<<( ostream &output, const aClient &c); | |
14 | ||
15 | public: | |
16 | aClient(char *); // Constructor takes a char for the nick | |
17 | aClient(const aClient &); // Copy constructor | |
18 | aClient(); // Default constructor | |
19 | ~aClient(); // Destructor | |
20 | ||
21 | // Sets the client's player struct data to the same thing as another aClient's | |
22 | // player struct data | |
23 | void setData(const aClient *); | |
24 | ||
25 | void setNick(char *n) { strcpy(nick, n);}; // Sets the client's nick | |
26 | char *getNick() { return nick; }; // Returns the client's nick | |
27 | Player *stats; // Pointer to the client's player struct | |
28 | ||
29 | long int getFlags() { return flags; }; // Returns the Client's current flags | |
30 | ||
31 | // Functions also return the flags after modifying them | |
32 | long int setFlags(long int); // Sets the clients flags to a new value | |
33 | long int addFlag(long int); // Adds a flag to the client's flags | |
34 | long int remFlag(long int); // Removes a flag from the client's current flags | |
35 | ||
36 | private: | |
37 | #ifdef P10 | |
38 | char realnick[32]; // Real Nickname | |
39 | #endif | |
40 | ||
41 | char nick[32]; // Client's current nickname. Numeric if P10 is used | |
42 | long int flags; // Client's current flags. | |
43 | }; | |
44 | ||
45 | #endif |