PPL Assignment
IRM2015006
boy.cpp
Go to the documentation of this file.
1 #include "boy.h"
2 
3 bool compareOnIntelligence (Boy *b1, Boy *b2)
4 {
5  return b1->intel > b2->intel;
6 }
7 
9 {
10  return b1->attr > b2->attr;
11 }
12 
13 bool compareOnRichness (Boy *b1, Boy *b2)
14 {
15  return b1->budget > b2->budget;
16 }
17 
18 void Boy::makeCouple(Girl *girl)
19 {
20  this->girlfriend = girl;
21 }
22 
24 {
25  return ( (girl->attr >= this->min_attr_req) &&
26  (girl->budget <= this->budget) );
27 }
28 
29 void Boy::setGiftBasket(std::vector<Gift> *gifts)
30 {
31  this->gifts = gifts;
32 }
33 
34 // Boy::Boy()
35 // {
36 // this->committed = false;
37 // this->girlfriend = NULL;
38 // this->gifts = NULL;
39 // this->happiness = 0;
40 // }
41 
42 // Boy::Boy(std::string name, int attr, int intel, int budget, int min_attr_req)
43 // {
44 // this->name = name;
45 // this->intel = intel;
46 // this->attr = attr;
47 // this->budget = budget;
48 // this->min_attr_req = min_attr_req;
49 // this->committed = false;
50 // this->happiness = 0;
51 // this->girlfriend = NULL;
52 // this->gifts = NULL;
53 // }
void makeCouple(Girl *girl)
Definition: boy.cpp:18
int attr
Definition: boy.h:25
bool compareOnIntelligence(Boy *b1, Boy *b2)
Definition: boy.cpp:3
std::vector< Gift > * gifts
Definition: boy.h:33
bool isCompatible(Girl *girl)
Definition: boy.cpp:23
Definition: girl.h:18
int budget
Definition: boy.h:27
int intel
Definition: boy.h:26
Definition: boy.h:20
int attr
Definition: girl.h:25
void setGiftBasket(std::vector< Gift > *gifts)
Definition: boy.cpp:29
Girl * girlfriend
Definition: boy.h:30
bool compareOnAttractiveness(Boy *b1, Boy *b2)
Definition: boy.cpp:8
int budget
Definition: girl.h:27
bool compareOnRichness(Boy *b1, Boy *b2)
Definition: boy.cpp:13