Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

Landslip Class Reference

Inheritance diagram for Landslip:

Inheritance graph
[legend]
Collaboration diagram for Landslip:

Collaboration graph
[legend]

Detailed Description

Landslip for every round.

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.


Constructor & Destructor Documentation

Landslip::Landslip const ModelList models  ) 
 

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 }

Landslip::~Landslip  ) 
 

Definition at line 23 of file Landslip.cpp.

00024 {
00025     delete[] m_stoned;
00026 }


Member Function Documentation

bool Landslip::computeFall  ) 
 

Indentify falling objects.

Returns:
whether something is falling.

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 }

bool Landslip::fallModel Cube model  ) 
 

Let model to fall.

Returns:
true when model is falling

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 }

Cube::eWeight Landslip::getImpact  )  [inline]
 

Definition at line 26 of file Landslip.h.

00026 { return m_impact; }

bool Landslip::stoneModel const Cube model  ) 
 

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 }


The documentation for this class was generated from the following files:
Generated on Wed Jun 1 09:55:32 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2