-
Notifications
You must be signed in to change notification settings - Fork 0
/
Channel.hpp
79 lines (61 loc) · 1.63 KB
/
Channel.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#pragma once
#include <iostream>
#include <string>
#include "Server.hpp"
#include "Client.hpp"
#define MD_I 0
#define MD_T 1
#define MD_K 2
#define MD_L 3
class Client;
struct s_server;
class Channel {
private:
std::string _name;
std::string _topic;
std::string _key;
bool _mode[4];
//bot
bool _pokespawned;
std::string _pokename;
int _pokechance;
Channel();
public:
std::set<int> _clients;
std::set<std::string> _operators;
std::set<std::string> _invited;
std::string _password;
int _limit;
int _count;
Channel(std::string const &name);
Channel(Channel const &src);
~Channel();
Channel &operator=(Channel const &rhs);
std::string getName() const;
std::string getTopic() const;
std::string getKey() const;
std::set<int> getClients() const;
std::set<std::string> getOperators() const;
bool getMode(int const &mode) const;
bool isOperator(std::string const &client) const;
bool isInChannel(int fd) const;
void setTopic(std::string const &topic);
void setKey(std::string const &key);
void setMode(int const &mode, bool const &value);
void addClient(int client);
void addOperator(std::string &client);
void addInvited(std::string &client);
void removeClient(int client);
void removeOperator(std::string &client);
void sendMsg(std::string const &msg);
//bot
bool pokeSpawn(void);
bool pokeIsSpawned(void);
bool pokeCatch(Client &they);
std::string pokeName(void) const;
//bot
bool pokeSpawn(void);
bool pokeIsSpawned(void);
bool pokeCatch(Client &they);
std::string pokeName(void) const;
};