PPL Assignment
IRM2015006
Main Page
Classes
Files
File List
File Members
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
16
float
GeekBoy::getHappiness
()
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
27
BoyNature
GeekBoy::getNature
()
28
{
29
return
nature
;
30
}
Boy::committed
bool committed
Definition:
boy.h:32
Boy::attr
int attr
Definition:
boy.h:25
Boy::gifts
std::vector< Gift > * gifts
Definition:
boy.h:33
Boy::happiness
float happiness
Definition:
boy.h:29
GeekBoy::getNature
BoyNature getNature() override
Definition:
geekboy.cpp:27
geekboy.h
GeekBoy::getHappiness
float getHappiness() override
Definition:
geekboy.cpp:16
Boy::min_attr_req
int min_attr_req
Definition:
boy.h:28
Boy::budget
int budget
Definition:
boy.h:27
Boy::intel
int intel
Definition:
boy.h:26
GeekBoy::nature
static const BoyNature nature
Definition:
geekboy.h:12
Boy::name
std::string name
Definition:
boy.h:24
Boy::girlfriend
Girl * girlfriend
Definition:
boy.h:30
GeekBoy::GeekBoy
GeekBoy(std::string name, int attr, int intel, int budget, int min_attr_req)
Definition:
geekboy.cpp:3
BoyNature
BoyNature
Definition:
boy_type.h:5
Girl::intel
int intel
Definition:
girl.h:26
boys
geekboy.cpp
Generated by
1.8.11