PPL Assignment
IRM2015006
geekboy.cpp
Go to the documentation of this file.
1 #include "geekboy.h"
2 
3 GeekBoy::GeekBoy(std::string name, int attr, int intel, int budget, int min_attr_req)
4 {
5  this->name = name;
6  this->intel = intel;
7  this->attr = attr;
8  this->budget = budget;
9  this->min_attr_req = min_attr_req;
10  this->committed = false;
11  this->happiness = 0;
12  this->girlfriend = NULL;
13  this->gifts = NULL;
14 }
15 
17 {
18  float happiness = 0;
19  if (!committed || !girlfriend || !gifts)
20  return -1;
21 
22  happiness = this->girlfriend->intel;
23  this->happiness = happiness;
24  return happiness;
25 }
26 
28 {
29  return nature;
30 }
bool committed
Definition: boy.h:32
int attr
Definition: boy.h:25
std::vector< Gift > * gifts
Definition: boy.h:33
float happiness
Definition: boy.h:29
BoyNature getNature() override
Definition: geekboy.cpp:27
float getHappiness() override
Definition: geekboy.cpp:16
int min_attr_req
Definition: boy.h:28
int budget
Definition: boy.h:27
int intel
Definition: boy.h:26
static const BoyNature nature
Definition: geekboy.h:12
std::string name
Definition: boy.h:24
Girl * girlfriend
Definition: boy.h:30
GeekBoy(std::string name, int attr, int intel, int budget, int min_attr_req)
Definition: geekboy.cpp:3
BoyNature
Definition: boy_type.h:5
int intel
Definition: girl.h:26