Lab 8  Version 8
This is an array of shapes
 All Classes Functions
Public Member Functions | List of all members
ShapeStore Class Reference

Public Member Functions

 ShapeStore ()
 
void addShape (Shape shape)
 
Shape findShapeWithMostSides () const
 
Shape findShapeWithThisColor (string color) const
 

Constructor & Destructor Documentation

ShapeStore::ShapeStore ( )

This is the constructor. At least it must set the count to 0.

Member Function Documentation

void ShapeStore::addShape ( Shape  shape)

This will attempt to add the shape to the array at the last unused location.

Parameters
shape- this is the Shape that you would like to add to the store
Shape ShapeStore::findShapeWithMostSides ( ) const

This method will search the list for the shape with them most number of sides. If there are more than 1 shape with the same number of sides which is the largest number, then return the first one.

Returns
the shape with the most number of sides
Shape ShapeStore::findShapeWithThisColor ( string  color) const

This method will search the list looking for a shape with the given color. If there is no shape with the color that was given then return the default shape, Shape(). If there is more than one shape with the given color, return the first one.

Parameters
color- the color of the shape we wish to find
Returns
the shape that matches the given color if found and the default shape otherwise

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