7b305fc670d5bf2cfadfffe32467d746c76ef94b
[tropbot.git] / objects.cc
1 //-----------------------------------------------------------------------------
2
3 #include "objects.h"
4 #include "tblib.h"
5
6 extern int current_time;
7
8 //-----------------------------------------------------------------------------
9
10 WaitInfos::WaitInfos(char *n, char *c, DCCChat *ch, char *u, int m, int d)
11 {
12   nick = strdup(n);
13   comment = strdup(c);
14   chat = ch;
15   user = strdup(u);
16   mode = m;
17   duration = d;
18 };
19
20 WaitInfos::~WaitInfos()
21 {
22   delete nick;
23   delete comment;
24   delete user;
25 };
26
27 Welcome::Welcome(char *p, char *c, int time)
28 {
29   pattern = strdup(p);
30   comment = strdup(c);
31   time_max = time;
32 };
33
34 Welcome::~Welcome()
35 {
36   delete pattern;
37   delete comment;
38 };
39
40 //-----------------------------------------------------------------------------
41
42 DelayModeChange::DelayModeChange(char *w, char *m, char *p, int delay)
43 {
44   where = strdup(w);
45   mode = strdup(m);
46   parameter = strdup(p);
47   time = delay+current_time;
48 };
49
50 DelayModeChange::~DelayModeChange()
51 {
52   delete where;
53   delete mode;
54   delete parameter;
55 };
56
57 //-----------------------------------------------------------------------------
58
59 Person::Person(char *p, int l, char *pwd)
60 {
61   pattern = strdup(p);
62   level = l;
63   passwd = strdup(pwd);
64 };
65
66 Person::~Person()
67 {
68   delete pattern;
69 };
70
71 //-----------------------------------------------------------------------------
72
73 DCCChat::DCCChat(char *p, int s, int l)
74 {
75   prefix = strdup(p);
76   socket = s;
77   level = l;
78 };
79
80 DCCChat::~DCCChat()
81 {
82   delete prefix;
83 };
84
85 //-----------------------------------------------------------------------------