[project @ 2002-07-07 02:33:51 by unknown_lamer]
[clinton/bobotpp.git] / source / Person.C
1 // Person.C -*- C++ -*-
2 // Copyright (c) 1998 Etienne BERNARD
3
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // any later version.
8
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
17
18 #include "Utils.H"
19 #include "Person.H"
20
21 Person::Person(Bot *b, String a)
22 : bot(b), address(a)
23 { }
24
25 Person::Person(Person &p)
26 : bot(p.bot), address(p.address)
27 { }
28
29 Person *
30 Person::copy()
31 {
32 return new Person(*this);
33 }
34
35 String
36 Person::getNick() const
37 {
38 return Utils::getNick(address);
39 }
40
41 String
42 Person::getAddress() const
43 {
44 return address;
45 }
46
47 Person &
48 Person::operator=(const String & a)
49 {
50 address = a;
51 return *this;
52 }
53
54 void
55 Person::sendNotice(String message)
56 {
57 bot->serverConnection->queue->sendNotice(getNick(), message);
58 }