-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ladder.h
32 lines (21 loc) · 661 Bytes
/
Ladder.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
#ifndef __LADDER_H__
#define __LADDER_H__
#include "MapObject.h"
// constant character for drawing on screen
const char LADDER_CHAR = '|';
class Ladder : public MapObject {
private:
int length; // length of the section of Ladder
public:
// constructor for Ladder needs length of section of Ladder
Ladder(df::Position init_pos, int init_length);
// get the length of the section of Ladder
int getLength() const;
// set the length of the section of Ladder
void setLength(int new_length);
// return true if position falls on Ladder, false otherwise
bool onMapObject(df::Position pos) const;
// Draw the Ladder in place
void draw();
};
#endif