PPL Assignment
IRM2015006
gift.cpp
Go to the documentation of this file.
1 #include "gift.h"
2 
3 bool compareOnValue (Gift g1, Gift g2)
4 {
5  return (g1.value > g2.value);
6 }
7 
8 bool compareOnPriceAsc (Gift g1, Gift g2)
9 {
10  return (g1.price < g2.value);
11 }
12 
14 {
15  return (g1.price > g2.price);
16 }
17 
18 
20 {
21  this->gifted = false;
22 }
23 
24 Gift::Gift(std::string name, GiftType type, int price, int value)
25 {
26  this->name = name;
27  this->type = type;
28  this->price = price;
29  this->value = value;
30  this->gifted = false;
31 }
Gift()
Definition: gift.cpp:19
std::string name
Definition: gift.h:17
int price
Definition: gift.h:19
bool compareOnPriceAsc(Gift g1, Gift g2)
Definition: gift.cpp:8
bool gifted
Definition: gift.h:21
GiftType type
Definition: gift.h:18
int value
Definition: gift.h:20
bool compareOnValue(Gift g1, Gift g2)
Definition: gift.cpp:3
GiftType
Definition: gift.h:7
bool compareOnPriceDesc(Gift g1, Gift g2)
Definition: gift.cpp:13
Definition: gift.h:14