lab_inheritance
Insidious Inheritance
Flower Class Reference

A subclass of Drawable that can draw a flower. More...

#include <flower.h>

Inheritance diagram for Flower:
[legend]
Collaboration diagram for Flower:
[legend]

Public Member Functions

 Flower (const Vector2 &center)
 
void draw (cs225::PNG *canvas) const
 This method will draw the object onto the canvas. More...
 
- Public Member Functions inherited from Drawable
 ~Drawable ()
 

Private Member Functions

void drawPetals (cs225::PNG *canvas, const Vector2 &center, int x, int y) const
 

Private Attributes

Shape stem
 
Shape pistil
 
Shape leaf
 

Detailed Description

A subclass of Drawable that can draw a flower.

Constructor & Destructor Documentation

◆ Flower()

Flower::Flower ( const Vector2 center)

Member Function Documentation

◆ draw()

void Flower::draw ( cs225::PNG canvas) const
virtual

This method will draw the object onto the canvas.

Parameters
canvasto draw onto.

Implements Drawable.

◆ drawPetals()

void Flower::drawPetals ( cs225::PNG canvas,
const Vector2 center,
int  x,
int  y 
) const
private

Member Data Documentation

◆ leaf

Shape Flower::leaf
private

◆ pistil

Shape Flower::pistil
private

◆ stem

Shape Flower::stem
private

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