// ferrysimview.h // ---------------------------------------------------------------------- // // CSE 143 // Homework 4 // http://www.cs.washington.edu/education/courses/143/00su/homework/ // 21 Jul 2000, Man-Hing Wong, Martin Dickey, Ken Yasuhara #ifndef _FERRYSIMVIEW_H_ #define _FERRYSIMVIEW_H_ #include #include "carqueue.h" #include "ferrysim.h" #include "GP142display.h" #include "GP142.h" // This is needed because the classes FerrySim and FerrySimView // reference each other. class FerrySim; class FerrySimView { public: FerrySimView(FerrySim *newSimPtr, double newTimeUnitsPerGP142Event); // paint the overall picture void paintSnapshot(); // paint a car queue starting at location (x, y) void paintCarQueue(const CarQueue &carQ, int x, int y); // paint a car and number of passenger at location (x, y) void paintCar(const Car *carPtr, int x, int y); // paint a ferry at location (x, y) void paintFerry(int x, int y); // paint heading, ticket office, boarding station and dock void paintBackground(); // paint statistics such as time, number of car boarded and // total ticket revenue void paintStatistics(); // cause delay proportional to specified duration void pause (int duration); private: // disallow default construction, copy construction, assignment, // not only in client code, but also inside methods FerrySimView() { assert(false); } FerrySimView(const FerrySimView &other) { assert(false); } FerrySimView &operator=(const FerrySimView &other) { assert(false); return *this; } FerrySim *simPtr; GP142Display display; // make this constant larger for faster simulation, // smaller to slow it down double timeUnitsPerGP142Event; }; #endif // _FERRYSIMVIEW_H_