Public Member Functions | List of all members
Tank Class Reference

Represents a collection of Fish. More...

#include <tank.h>

Public Member Functions

 Tank (std::vector< Fish * > fish)
void draw (Screen *screen) const
void tick ()

Detailed Description

Represents a collection of Fish.

Communicates the passage of time to its constituent Fish and also draws them to a Screen.

Definition at line 12 of file tank.h.

Constructor & Destructor Documentation

◆ Tank()

Tank::Tank ( std::vector< Fish * >  fish)
fishAll the Fish to be added to the Tank. Caller owns the memory before and after constructing a Tank.

Definition at line 4 of file tank.cpp.

Member Function Documentation

◆ draw()

void Tank::draw ( Screen screen) const

Render all of the Fish to the given Screen. The caller is expected to provide a clear screen. Draws over whatever is already there with no concept of transparency.

Definition at line 6 of file tank.cpp.

◆ tick()

void Tank::tick ( )

Signal to every Fish that one unit of time has passed so that it may update its location. Calls Fish::tick on each.

Definition at line 12 of file tank.cpp.

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