Line data Source code
1 : /*
2 : * UserMock.cpp
3 : *
4 : * Created on: Jun 2, 2016
5 : * Author: tobias
6 : */
7 :
8 : #include "User.h"
9 :
10 1341 : User::User() : id(0), age(18) {
11 1341 : location[0] = 0;
12 1341 : location[1] = 0;
13 1341 : }
14 :
15 1227 : void User::setInterests(Interests interest){
16 1227 : this->interests = interest;
17 1227 : }
18 :
19 40 : void User::addInterest(string category, string value){
20 40 : this->interests.add(category, value);
21 40 : }
22 :
23 0 : void User::removeInterest(string category, string value){
24 0 : this->interests.remove(category,value);
25 0 : }
26 :
27 1232 : void User::setId(int id){
28 1232 : this->id = id;
29 1232 : }
30 :
31 1277 : void User::setAge(int age){
32 1277 : this->age = age;
33 1277 : }
34 1277 : void User::setLocation(float x, float y){
35 1277 : this->location[LOC_X] = x;
36 1277 : this->location[LOC_Y] = y;
37 1277 : }
38 :
39 1118 : void User::setMail(std::string mail){
40 1118 : this->mail = mail;
41 1118 : }
42 :
43 1118 : void User::setAlias(std::string alias){
44 1118 : this->alias = alias;
45 1118 : }
46 :
47 1202 : void User::setName(std::string name){
48 1202 : this->name = name;
49 1202 : }
50 :
51 1202 : void User::setSex(std::string sex){
52 1202 : this->sex = sex;
53 1202 : }
54 :
55 75 : void User::setCommonData(std::string mail, std::string alias, std::string name, std::string sex){
56 75 : this->mail = mail;
57 75 : this->alias = alias;
58 75 : this->name = name;
59 75 : this->sex = sex;
60 75 : }
61 :
62 105 : void User::setDescription(std::string description){
63 105 : this->description = description;
64 105 : }
65 :
66 1138 : void User::setPhoto(std::string photo){
67 1138 : this->photo = photo;
68 1138 : }
69 :
70 1551 : std::string User::getMail(){
71 1551 : return this->mail;
72 : }
73 186 : std::string User::getName(){
74 186 : return this->name;
75 : }
76 186 : std::string User::getAlias(){
77 186 : return this->alias;
78 : }
79 154 : std::string User::getDescription(){
80 154 : return this->description;
81 : }
82 42 : std::string User::getPhoto(){
83 42 : return this->photo;
84 : }
85 457 : std::string User::getSex(){
86 457 : return this->sex;
87 : }
88 881 : int User::getID(){
89 881 : return this->id;
90 : }
91 240 : int User::getAge(){
92 240 : return this->age;
93 : }
94 501 : Interests* User::getInterests(){
95 501 : return &(this->interests);
96 : }
97 212 : float User::getX(){
98 212 : return this->location[LOC_X];
99 : }
100 207 : float User::getY(){
101 207 : return this->location[LOC_Y];
102 : }
103 :
104 2484 : User::~User() {
105 : // TODO Auto-generated destructor stub
106 2484 : }
107 :
|