Main Page   Class Hierarchy   Compound List   File List   Compound Members  

plant Class Reference

A class that implements green-material which is to be eaten by ants. More...

#include <plant.h>

List of all members.

Public Methods

 plant (double initialSize, double maxSize)
void update ()
 Makes the plant grow.

double eaten ()
 Makes the plant a bit smaller (by 5 units).

double eaten (double quantity)
 Makes the plant smaller because it is eaten by an ant. More...

double getSize ()
 Returns the current size of the plant.


Detailed Description

A class that implements green-material which is to be eaten by ants.


Constructor & Destructor Documentation

plant::plant double    initialSize,
double    maxSize
 

Parameters:
initialSize  Original plant size
maxSize  Maximum plant size


Member Function Documentation

double plant::eaten double    quantity
 

Makes the plant smaller because it is eaten by an ant.

Parameters:
quantity  How much does the ant want to eat ?
Returns:
How much was the ant actually able to eat, considering that the plant size can't be negative.


The documentation for this class was generated from the following files:
Generated on Mon Jun 14 09:29:38 2004 by doxygen1.2.15