House Class Reference

List of all members.

Public Member Functions

 setType ($strType)
 getType ()
 colapse ()
 isColapsed ()
 setPig (LittlePig $objPig)
 getPig ()
 getBlowBy (Wolf $objWolf)

Protected Attributes

 $strType
 $objPig
 $booIsColapsed = false


Detailed Description

House of the little pigs to the example of the code to diagram

Author:
Thiago Henrique Ramos da Mata <thiago.henrique.mata@gmail.com>

Definition at line 14 of file House.class.php.


Member Function Documentation

colapse (  ) 

Make the house colapse

Returns:
House me

Definition at line 68 of file House.class.php.

Referenced by getBlowBy().

00069     {
00070         $this->booIsColapsed = true;
00071         return $this;
00072     }

getBlowBy ( Wolf objWolf  ) 

Receive a blow from the wolf.

If the house has the type "Brick" the house dont colapse the the pig, owner of the house it is waked up by the wolf noise. But, if the house has not, the house colapse.

Return true if the house is colapsed and false if not

Parameters:
Wolf $objWolf
Returns:
boolean

Definition at line 127 of file House.class.php.

References colapse(), getPig(), getType(), and isColapsed().

Referenced by Wolf::blowIt().

00128     {
00129         if( $this->getType() == "Brick" )
00130         {
00131             $this->getPig()->wakeUpBy( $objWolf );
00132         }
00133         else
00134         {
00135             $this->colapse();
00136         }
00137         return $this->isColapsed();
00138     }

getPig (  ) 

Get the little pig onwer of the house

See also:
House::setPig( LittlePig )

House->objPig

Returns:
LittlePig

Definition at line 106 of file House.class.php.

Referenced by Wolf::blowIt(), and getBlowBy().

00107     {
00108         return $this->objPig;
00109     }

getType (  ) 

get the type of the house

See also:
House::setType( string )

House->strType

Returns:
string

Definition at line 58 of file House.class.php.

Referenced by getBlowBy().

00059     {
00060         return $this->strType;
00061     }

isColapsed (  ) 

Return true if the house is colapsed and false if not

Returns:
boolean

Definition at line 80 of file House.class.php.

Referenced by getBlowBy().

00081     {
00082         return $this->booIsColapsed;
00083     }

setPig ( LittlePig objPig  ) 

Set the little pig owner of the house

See also:
House::getPig()

House->objPig

Parameters:
LittlePig $objPig
Returns:
House me

Definition at line 93 of file House.class.php.

00094     {
00095         $this->objPig = $objPig;
00096         return $this;
00097     }

setType ( strType  ) 

Set the type of the house

See also:
House::getType()

House->strType

Parameters:
string $strType
Returns:
House me

Definition at line 45 of file House.class.php.

References $strType.

00046     {
00047         $this->strType = $strType;
00048         return $this;
00049     }


Member Data Documentation

$booIsColapsed = false [protected]

This controlls if the house has colapsed

boolean

Definition at line 35 of file House.class.php.

$objPig [protected]

Pig owner of the house

LittlePig

Definition at line 28 of file House.class.php.

$strType [protected]

Type of the house

string

Definition at line 21 of file House.class.php.

Referenced by setType().


The documentation for this class was generated from the following file:

Generated on Thu Feb 3 03:55:03 2011 for CodeToDiagram by  doxygen 1.5.9