]>
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> |
8 | using std::ostream; | |
85ce9d3e | 9 | |
10 | class Player; // forward declaration | |
11 | ||
12 | class aClient { | |
13 | ||
14 | friend ostream &operator<<( ostream &output, const aClient &c); | |
15 | ||
16 | public: | |
96f71fee | 17 | aClient(char *); // Constructor takes a char for the nick |
ce61cdfa | 18 | |
19 | #ifdef P10 | |
20 | aClient(char *, char *); // Constructor takes a char for the nick and realnick | |
21 | #endif | |
22 | ||
96f71fee | 23 | aClient(const aClient &); // Copy constructor |
24 | aClient(); // Default constructor | |
25 | ~aClient(); // Destructor | |
85ce9d3e | 26 | |
96f71fee | 27 | // Sets the client's player struct data to the same thing as another aClient's |
28 | // player struct data | |
85ce9d3e | 29 | void setData(const aClient *); |
96f71fee | 30 | |
31 | void setNick(char *n) { strcpy(nick, n);}; // Sets the client's nick | |
32 | char *getNick() { return nick; }; // Returns the client's nick | |
ce61cdfa | 33 | |
34 | #ifdef P10 | |
35 | void setRealNick(char *rn) { strcpy(realnick, rn);}; // Sets the client's realnick | |
7f17db99 | 36 | char *getRealNick() { return realnick; }; // Returns the client's real text nickname |
ce61cdfa | 37 | #endif |
38 | ||
96f71fee | 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 | |
85ce9d3e | 47 | |
48 | private: | |
ce61cdfa | 49 | #ifdef P10 |
50 | char realnick[32]; // Client's text nickname. Not the numeric | |
51 | #endif | |
fc9d2643 | 52 | char nick[32]; // Client's current nickname. Numeric if P10 is used |
96f71fee | 53 | long int flags; // Client's current flags. |
85ce9d3e | 54 | }; |
55 | ||
56 | #endif |