Debian Codegraph @

src/level/OnStack.h

raw
1 #ifndef HEADER_ONSTACK_H
2 #define HEADER_ONSTACK_H
3
4 #include "OnCondition.h"
5 #include "Cube.h"
6 #include "Rules.h"
7
8 /**
9 * Test whether object can carry moved stack.
10 */
11 class OnStack : public OnCondition {
12 public:
13 virtual bool isSatisfy(Cube *model) const
14 {
15 bool result = false;
16 if (!model->isAlive()) {
17 if (model->rules()->getDir() == Dir::DIR_NO
18 && model->rules()->isOnStrongPad(Cube::LIGHT))
19 {
20 result = true;
21 }
22 }
23 return result;
24 }
25
26 virtual bool isWrong(Cube *model) const
27 {
28 return model->isAlive();
29 }
30 };
31
32 #endif