]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ACLIENT_H | |
2 | #define ACLIENT_H | |
3 | ||
4 | #include <string.h> | |
5 | #include "options.h" | |
6 | #include "player.h" | |
7 | #include <iostream> | |
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(const string &); // Constructor takes a char for the nick | |
17 | ||
18 | #ifdef P10 | |
19 | aClient(char *, char *); // Constructor takes a char for the nick and realnick | |
20 | #endif | |
21 | ||
22 | bool operator==(const aClient &); | |
23 | bool operator!=(const aClient &); | |
24 | aClient(const aClient &); // Copy constructor | |
25 | aClient(); // Default constructor | |
26 | ~aClient(); // Destructor | |
27 | ||
28 | // Sets the client's player struct data to the same thing as another aClient's | |
29 | // player struct data | |
30 | void setData(const aClient *); | |
31 | ||
32 | void setNick(char *n) { strcpy(nick, n);}; // Sets the client's nick | |
33 | char *getNick() { return nick; }; // Returns the client's nick | |
34 | ||
35 | #ifdef P10 | |
36 | void setRealNick(char *rn) { strcpy(realnick, rn);}; // Sets the client's realnick | |
37 | char *getRealNick() { return realnick; }; // Returns the client's real text nickname | |
38 | #endif | |
39 | ||
40 | Player *stats; // Pointer to the client's player struct | |
41 | ||
42 | long int getFlags() { return flags; }; // Returns the Client's current flags | |
43 | ||
44 | // Functions also return the flags after modifying them | |
45 | long int setFlags(long int); // Sets the clients flags to a new value | |
46 | long int addFlag(long int); // Adds a flag to the client's flags | |
47 | long int remFlag(long int); // Removes a flag from the client's current flags | |
48 | ||
49 | private: | |
50 | #ifdef P10 | |
51 | char realnick[32]; // Client's text nickname. Not the numeric | |
52 | #endif | |
53 | char nick[32]; // Client's current nickname. Numeric if P10 is used | |
54 | long int flags; // Client's current flags. | |
55 | }; | |
56 | ||
57 | #endif |