]>
Commit | Line | Data |
---|---|---|
85ce9d3e | 1 | #ifndef ACLIENT_H |
2 | #define ACLIENT_H | |
3 | ||
4 | #include <string.h> | |
85ce9d3e | 5 | #include "player.h" |
fb37ecc7 | 6 | #include <iostream> |
7 | using std::ostream; | |
85ce9d3e | 8 | |
9 | class Player; // forward declaration | |
10 | ||
11 | class aClient { | |
12 | ||
13 | friend ostream &operator<<( ostream &output, const aClient &c); | |
14 | ||
15 | public: | |
96f71fee | 16 | aClient(char *); // Constructor takes a char for the nick |
17 | aClient(const aClient &); // Copy constructor | |
18 | aClient(); // Default constructor | |
19 | ~aClient(); // Destructor | |
85ce9d3e | 20 | |
96f71fee | 21 | // Sets the client's player struct data to the same thing as another aClient's |
22 | // player struct data | |
85ce9d3e | 23 | void setData(const aClient *); |
96f71fee | 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 | |
85ce9d3e | 35 | |
36 | private: | |
fc9d2643 | 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 | |
96f71fee | 42 | long int flags; // Client's current flags. |
85ce9d3e | 43 | }; |
44 | ||
45 | #endif |