Definition at line 11 of file Landslip.h.
Public Member Functions | |
Landslip (const ModelList &models) | |
~Landslip () | |
bool | computeFall () |
Indentify falling objects. | |
Cube::eWeight | getImpact () |
bool | stoneModel (const Cube *model) |
bool | fallModel (Cube *model) |
Let model to fall. |
|
Definition at line 15 of file Landslip.cpp. 00016 : m_models(models) 00017 { 00018 m_impact = Cube::NONE; 00019 m_stoned = new bool[m_models.size()]; 00020 memset(m_stoned, false, sizeof(bool) * m_models.size()); 00021 }
|
|
Definition at line 23 of file Landslip.cpp. 00024 {
00025 delete[] m_stoned;
00026 }
|
|
Indentify falling objects.
Definition at line 33 of file Landslip.cpp. 00034 { 00035 while (m_models.stoneOn(this)) { 00036 /* empty */ 00037 } 00038 return m_models.fallOn(this); 00039 }
|
|
Let model to fall.
Definition at line 100 of file Landslip.cpp. 00101 { 00102 bool falling = false; 00103 if (!isFixed(model)) { 00104 model->rules()->actionFall(); 00105 falling = true; 00106 } 00107 else { 00108 bool lastFall = model->rules()->clearLastFall(); 00109 if (lastFall && m_impact < model->getWeight()) { 00110 m_impact = model->getWeight(); 00111 } 00112 } 00113 return falling; 00114 }
|
|
Definition at line 26 of file Landslip.h. 00026 { return m_impact; }
|
|
Definition at line 42 of file Landslip.cpp. 00043 { 00044 bool change = false; 00045 if (!isStoned(model)) { 00046 if (isFixed(model) || isOnPad(model)) { 00047 stone(model); 00048 change = true; 00049 } 00050 } 00051 return change; 00052 }
|