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