00001 #ifndef HEADER_ONSTRONGPAD_H 00002 #define HEADER_ONSTRONGPAD_H 00003 00004 #include "OnCondition.h" 00005 #include "Cube.h" 00006 00007 /** 00008 * Test whether model is on Wall or on powerful fish. 00009 */ 00010 class OnStrongPad : public OnCondition { 00011 private: 00012 Cube::eWeight m_weight; 00013 public: 00014 OnStrongPad(Cube::eWeight weight) { m_weight = weight; } 00015 00016 virtual bool isSatisfy(Cube *model) const 00017 { 00018 return model->isWall() 00019 || (model->isAlive() && model->getPower() >= m_weight); 00020 } 00021 00022 virtual bool isWrong(Cube *model) const 00023 { 00024 return model->isAlive() && model->getPower() < m_weight; 00025 } 00026 }; 00027 00028 #endif