]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ACLIENT_H | |
2 | #define ACLIENT_H | |
3 | ||
4 | #include <string.h> | |
5 | #include <iostream.h> | |
6 | #include "player.h" | |
7 | ||
8 | class Player; // forward declaration | |
9 | ||
10 | class aClient { | |
11 | ||
12 | friend ostream &operator<<( ostream &output, const aClient &c); | |
13 | ||
14 | public: | |
15 | aClient(char *); // Constructor takes a char for the nick | |
16 | aClient(const aClient &); // Copy constructor | |
17 | aClient(); // Default constructor | |
18 | ~aClient(); // Destructor | |
19 | ||
20 | // Sets the client's player struct data to the same thing as another aClient's | |
21 | // player struct data | |
22 | void setData(const aClient *); | |
23 | ||
24 | void setNick(char *n) { strcpy(nick, n);}; // Sets the client's nick | |
25 | char *getNick() { return nick; }; // Returns the client's nick | |
26 | Player *stats; // Pointer to the client's player struct | |
27 | ||
28 | long int getFlags() { return flags; }; // Returns the Client's current flags | |
29 | ||
30 | // Functions also return the flags after modifying them | |
31 | long int setFlags(long int); // Sets the clients flags to a new value | |
32 | long int addFlag(long int); // Adds a flag to the client's flags | |
33 | long int remFlag(long int); // Removes a flag from the client's current flags | |
34 | ||
35 | private: | |
36 | char nick[32]; // Client's current nickname. | |
37 | long int flags; // Client's current flags. | |
38 | }; | |
39 | ||
40 | #endif |