#ifndef _DISPLAY_H #define _DISPLAY_H /** * Aquarium Lab Series * Copyright (C) 2000 Alyce Brady * * The Display class provides operators that display an Aquarium * and a fish or an apvector of fish (instances of the AquaFish * class). The actual Display behavior depends on the * implementation chosen (text-based and graphics versions are * available). * * Author: Alyce Brady * * Created: 7/1/99 * Modified 2/6/2000 Modified to create a single interface * for the text-based and graphical * versions of the Display class. * * Acknowledgements: * This class is part of the Aquarium Lab Series, which was inspired * by the AP Marine Biology Case Study found at * http://www.collegeboard.org/ap/computer-science/marine_biology/ * This Display class is NOT the same as the Display class in Part II * of the Case Study, but is loosely based on that class. * * License: * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ //#include "CMUgraphicsLib\CMUgraphics.h" #include "apvector.h" #include "aquarium.h" class AquaFish; class Display { public: // constructors Display(Aquarium a); // postcondition: ready to display an Aquarium or AquaFish // (text-based display) /* Display(window & w, Aquarium a); // postcondition: ready to display an Aquarium or AquaFish // (graphical display) */ // modifier functions (modifiers because they change the state of the output) void ShowAquarium(); // postcondition: aquarium passed to constructor has been displayed void Show(AquaFish f); // postcondition: f displayed void Show(apvector school); // postcondition: all fish in school displayed private: // private data member used for text-based & graphical display Aquarium theAquarium; // the aquarium containing fish // private data members used for graphical display only /* window & myWindow; // the graphical display window (refers // to actual window in main function) int aquaLeft; // x-coordinate of aquarium left wall int aquaTop; // y-coordinate of aquarium top int widthScale; // how many pixels per unit width int heightScale; // how many pixels per unit height */ }; #endif