#ifndef _GBALLOON_H #define _GBALLOON_H // class for balloon manipulation using simulated auto pilot // (based on an idea of Dave Reed) graphics version 3/22/99 // // Ascend: rise to specified height in a sequence of burns // Each burn raises the altitude by 10 meters // // Cruise: cruise for specified time-steps/seconds // Random wind-shear can cause balloon to rise and fall, // but vents and burns keep ballon within 5 m. of start altitude // // Descend: descend to specified height in sequence of vents // Each vent drops the balloon 10 m. or to ground if < 10 m. // // int GetAltitude: returns altitude (in meters) (y-coord) // int GetLocation: returns how many time steps/secs elapsed (x-coord) #include "canvas.h" #include "utils.h" class Balloon { public: Balloon(); // use default color (gold) Balloon(color c); // balloon of specified color void Ascend (int height); // ascend so altitude >= parameter void Descend (int height); // descend so altitude <= parameter void Cruise (int steps); // cruise for parameter time-steps int GetAltitude() const; // returns height above ground (y-coord) int GetLocation() const; // returns # time-steps (x-coord) private: void Burn(); void Vent(); int myAltitude; int mySteps; // ... see gballoon.h for details }; #endif