PPL Assignment
IRM2015006
Boy Class Referenceabstract

#include <boy.h>

Inheritance diagram for Boy:
Inheritance graph
Collaboration diagram for Boy:
Collaboration graph

Public Member Functions

void makeCouple (Girl *girl)
 
void setGiftBasket (std::vector< Gift > *gifts)
 
bool isCompatible (Girl *girl)
 
virtual float getHappiness ()=0
 
virtual BoyNature getNature ()=0
 

Public Attributes

std::string name
 
int attr
 
int intel
 
int budget
 
int min_attr_req
 
float happiness
 
Girlgirlfriend
 
bool committed
 
std::vector< Gift > * gifts
 

Detailed Description

Class for boy

Definition at line 20 of file boy.h.

Member Function Documentation

virtual float Boy::getHappiness ( )
pure virtual

Calculate happiness of the boy. Abstract method

Implemented in GenerousBoy, GeekBoy, and MiserBoy.

Here is the caller graph for this function:

virtual BoyNature Boy::getNature ( )
pure virtual

Get nature of boy Abstract method

Implemented in GenerousBoy, GeekBoy, and MiserBoy.

Here is the caller graph for this function:

bool Boy::isCompatible ( Girl girl)

Check if the girl is compatible with the boy

Definition at line 23 of file boy.cpp.

void Boy::makeCouple ( Girl girl)

Make 'her' 'his' girlfriend

Definition at line 18 of file boy.cpp.

Here is the caller graph for this function:

void Boy::setGiftBasket ( std::vector< Gift > *  gifts)

Set vector of gifts for the boy

Definition at line 29 of file boy.cpp.

Here is the caller graph for this function:

Member Data Documentation

int Boy::attr

Attractiveness

Definition at line 25 of file boy.h.

int Boy::budget

Max money boy can spend

Definition at line 27 of file boy.h.

bool Boy::committed

If he is committed

Definition at line 32 of file boy.h.

std::vector<Gift>* Boy::gifts

Vector of gifts the boy has gifted

Definition at line 33 of file boy.h.

Girl* Boy::girlfriend

Reference of his girlfriend

Definition at line 30 of file boy.h.

float Boy::happiness

Happiness of the boy

Definition at line 29 of file boy.h.

int Boy::intel

Intelligence

Definition at line 26 of file boy.h.

int Boy::min_attr_req

Min attraction required from girl

Definition at line 28 of file boy.h.

std::string Boy::name

Name of boy

Definition at line 24 of file boy.h.


The documentation for this class was generated from the following files: