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

Goal Class Reference


Detailed Description

Goal for model.

Definition at line 9 of file Goal.h.

Public Member Functions

bool isSatisfy (const Cube *model) const
bool isWrong (const Cube *model) const
 Return whether goal cannot by solved any more.
bool shouldGoOut () const

Static Public Member Functions

static Goal noGoal ()
static Goal outGoal ()
static Goal escapeGoal ()
static Goal aliveGoal ()


Member Function Documentation

Goal Goal::aliveGoal  )  [static]
 

Definition at line 39 of file Goal.cpp.

00040 {
00041     return Goal(SATISFY_IGNORE, SATISFY_TRUE);
00042 }

Goal Goal::escapeGoal  )  [static]
 

Definition at line 33 of file Goal.cpp.

00034 {
00035     return Goal(SATISFY_TRUE, SATISFY_TRUE);
00036 }

bool Goal::isSatisfy const Cube model  )  const
 

Definition at line 45 of file Goal.cpp.

00046 {
00047     bool result = true;
00048     if (SATISFY_TRUE == m_out) {
00049         result &= model->isOut(); 
00050     }
00051     else if (SATISFY_FALSE == m_out) {
00052         result &= (!model->isOut());
00053     }
00054 
00055     if (SATISFY_TRUE == m_alive) {
00056         result &= model->isAlive();
00057     }
00058     else if (SATISFY_FALSE == m_alive) {
00059         result &= (!model->isAlive());
00060     }
00061 
00062     return result;
00063 }

bool Goal::isWrong const Cube model  )  const
 

Return whether goal cannot by solved any more.

Dead fish cannot be revived. Object out of room cannot go back.

Definition at line 71 of file Goal.cpp.

00072 {
00073     bool wrong = false;
00074     if (SATISFY_TRUE == m_alive) {
00075         wrong |= !model->isAlive();
00076     }
00077 
00078     if (SATISFY_FALSE == m_out) {
00079         wrong |= model->isOut();
00080     }
00081     return wrong;
00082 }

Goal Goal::noGoal  )  [static]
 

Definition at line 21 of file Goal.cpp.

00022 {
00023     return Goal(SATISFY_IGNORE, SATISFY_IGNORE);
00024 }

Goal Goal::outGoal  )  [static]
 

Definition at line 27 of file Goal.cpp.

00028 {
00029     return Goal(SATISFY_TRUE, SATISFY_IGNORE);
00030 }

bool Goal::shouldGoOut  )  const
 

Definition at line 85 of file Goal.cpp.

00086 {
00087     return SATISFY_TRUE == m_out;
00088 }


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