-
Notifications
You must be signed in to change notification settings - Fork 1
/
graph_EatableItem.h
executable file
·51 lines (32 loc) · 1.02 KB
/
graph_EatableItem.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef GRAPH_EATABLEITEM_H
#define GRAPH_EATABLEITEM_H
#include "graph_Item.h"
class h_EatableItem;
class graph_EatableItem : public graph_Item
{
public:
graph_EatableItem(Settings* settings, graph_Simulation* aGraph_Sim, h_EatableItem* anItem);
qreal getWidth() {return width;}
h_EatableItem* getItem() {return item;}
protected:
/*virtual*/ QRectF boundingRect() const;
/*virtual*/ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
QWidget *widget);
protected:
h_EatableItem* item;
qreal width;
QColor color;
};
class graph_Food : public graph_EatableItem
{
public:
graph_Food(Settings* settings, graph_Simulation* aGraph_Sim, h_EatableItem* anItem);
/*virtual*/ bool isGraphFood() const {return true;}
};
class graph_Poison : public graph_EatableItem
{
public:
graph_Poison(Settings* settings, graph_Simulation* aGraph_Sim, h_EatableItem* anItem);
/*virtual*/ bool isGraphPoison() const {return true;}
};
#endif // GRAPH_EATABLEITEM_H