PPL Assignment
IRM2015006
Main Page
Classes
Files
File List
File Members
girl.cpp
Go to the documentation of this file.
1
#include "
girl.h
"
2
3
#include <cmath>
4
#define BASE 1.1
5
6
bool
compareOnMaintenanceCost
(
Girl
*g1,
Girl
*g2)
7
{
8
return
(g1->
budget
> g2->
budget
);
9
}
10
11
// Girl::Girl()
12
// {
13
// this->committed = false;
14
// this->boyfriend = NULL;
15
// this->gifts = NULL;
16
// this->happiness = 0;
17
// }
18
19
// Girl::Girl(std::string name, int attr, int intel, int budget, BoyType boy_type)
20
// {
21
// this->name = name;
22
// this->attr = attr;
23
// this->intel = intel;
24
// this->budget = budget;
25
// this->boy_type = boy_type;
26
// this->committed = false;
27
// this->boyfriend = NULL;
28
// this->gifts = NULL;
29
// this->happiness = 0;
30
// }
31
32
bool
Girl::isCompatible
(
Boy
*boy)
33
{
34
return
(boy->
budget
>= this->budget);
35
}
36
37
void
Girl::makeCouple
(
Boy
*boy)
38
{
39
this->
boyfriend
= boy;
40
}
41
42
void
Girl::setGiftBasket
(std::vector<Gift> *
gifts
)
43
{
44
this->gifts =
gifts
;
45
}
Girl::isCompatible
bool isCompatible(Boy *boy)
Definition:
girl.cpp:32
Girl::makeCouple
void makeCouple(Boy *boy)
Definition:
girl.cpp:37
Girl::boyfriend
Boy * boyfriend
Definition:
girl.h:30
Girl
Definition:
girl.h:18
Boy::budget
int budget
Definition:
boy.h:27
Boy
Definition:
boy.h:20
Girl::gifts
std::vector< Gift > * gifts
Definition:
girl.h:32
compareOnMaintenanceCost
bool compareOnMaintenanceCost(Girl *g1, Girl *g2)
Definition:
girl.cpp:6
Girl::budget
int budget
Definition:
girl.h:27
Girl::setGiftBasket
void setGiftBasket(std::vector< Gift > *gifts)
Definition:
girl.cpp:42
girl.h
girls
girl.cpp
Generated by
1.8.11