-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPropSpec.h
More file actions
71 lines (56 loc) · 1.48 KB
/
Copy pathPropSpec.h
File metadata and controls
71 lines (56 loc) · 1.48 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Stores the ID, type, dimensions, and position of a prop in the field.
//
// Author: Michael DiBernardo
//
// REFERENCES:
// None
#ifndef __PROP_SPEC_H__
#define __PROP_SPEC_H__
#include "Basics.h"
class Orientation;
enum PropType {
ISLAND_PROP,
TROPHY_PROP,
THRONE_PROP,
TORCH_PROP,
BOX_PROP,
DOT_PROP,
FEAR_POWERUP_PROP,
FREEZE_POWERUP_PROP,
SPEED_POWERUP_PROP
};
class PropSpec {
public:
// Constructs a prop with the given stats.
PropSpec(int id, PropType p, double xPos, double yPos, double xDim, double yDim);
// Frees resources used by this object.
~PropSpec();
int getID() const;
PropType getType() const;
double getXPos() const;
double getYPos() const;
double getXDim() const;
double getYDim() const;
// Does the bounding box of this prop contain the given point?
bool contains(const Orientation& o) const;
// Is this prop currently part of the model?
bool isActive() const;
// Clips the given orientation out of the bounding box.
Orientation clip(const Orientation& toClip) const;
// Includes or excludes this prop from the model.
void setActive(bool flag);
private:
// Prop id as given in the spec file.
int myID_;
// Type of this prop.
PropType myType_;
// My positional/dimensional attributes.
double myXPos_;
double myYPos_;
double myXDim_;
double myYDim_;
// Is this prop "active" (i.e. if a dot, powerup, etc. is it still in play?)
bool active_;
DISALLOW_EVIL_CONSTRUCTORS(PropSpec);
};
#endif