forked from oreorider/snu_programming_methodology_project3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFood.h
More file actions
33 lines (27 loc) · 703 Bytes
/
Food.h
File metadata and controls
33 lines (27 loc) · 703 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef __FOOD_H_
#define __FOOD_H_
#include <string>
using namespace std;
typedef pair<int, int> intPair;
class Food {
public:
Food() : name("null"), size(0, 0), exp(0) {}
Food(string, intPair, int);
int getExp() const { return exp; }
string getName() const { return name; }
intPair getSize() const { return size; }
friend bool operator>(const Food &, const Food &);
private:
string name;
intPair size;
int exp;
};
class FoodInFridge : public Food {
public:
FoodInFridge(Food food, int x, int y) : Food(food) { pos = make_pair(x, y); }
intPair getPos() { return pos; }
void setPos(intPair &pos_) { pos = pos_; }
private:
intPair pos;
};
#endif