]>
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 | using std::ostream; | |
9 | ||
10 | class Player; // forward declaration | |
11 | ||
12 | class aClient { | |
13 | ||
14 | friend ostream &operator<<( ostream &output, const aClient &c); | |
15 | ||
16 | public: | |
17 | aClient(char *); // Constructor takes a char for the nick | |
18 | ||
19 | #ifdef P10 | |
20 | aClient(char *, char *); // Constructor takes a char for the nick and realnick | |
21 | #endif | |
22 | ||
23 | aClient(const aClient &); // Copy constructor | |
24 | aClient(); // Default constructor | |
25 | ~aClient(); // Destructor | |
26 | ||
27 | // Sets the client's player struct data to the same thing as another aClient's | |
28 | // player struct data | |
29 | void setData(const aClient *); | |
30 | ||
31 | void setNick(char *n) { strcpy(nick, n);}; // Sets the client's nick | |
32 | char *getNick() { return nick; }; // Returns the client's nick | |
33 | ||
34 | #ifdef P10 | |
35 | void setRealNick(char *rn) { strcpy(realnick, rn);}; // Sets the client's realnick | |
36 | char *getRealNick() { return realnick; }; // Returns the client's real nick | |
37 | #endif | |
38 | ||
39 | Player *stats; // Pointer to the client's player struct | |
40 | ||
41 | long int getFlags() { return flags; }; // Returns the Client's current flags | |
42 | ||
43 | // Functions also return the flags after modifying them | |
44 | long int setFlags(long int); // Sets the clients flags to a new value | |
45 | long int addFlag(long int); // Adds a flag to the client's flags | |
46 | long int remFlag(long int); // Removes a flag from the client's current flags | |
47 | ||
48 | private: | |
49 | #ifdef P10 | |
50 | char realnick[32]; // Client's text nickname. Not the numeric | |
51 | #endif | |
52 | char nick[32]; // Client's current nickname. Numeric if P10 is used | |
53 | long int flags; // Client's current flags. | |
54 | }; | |
55 | ||
56 | #endif |