// Weather.hpp : Weather class // // 26.11.1998 / DH - Genesis // 30.11.1998 / DH - Extended RainyWeather (collision detection) // // Copyright (c) 1998 Daniel Hartmeier. All rights reserved. #ifndef __Weather__ #define __Weather__ class Weather; class SunnyWeather; class RainyWeather; class Raindrop; #include "Sprite.hpp" #include "Level.hpp" #include "List.hpp" // ------------------------------------------------------------------- class Weather { public: Weather() : backgroundColor_r(0), backgroundColor_g(0), backgroundColor_b(0), baseIntensity(128) {} virtual ~Weather() {} virtual void getBackgroundColor(int &r, int &g, int &b) const { r = backgroundColor_r; g = backgroundColor_g; b = backgroundColor_b; return; } virtual int getBaseIntensity() const { return baseIntensity; } virtual void act(unsigned long pad) { return; } virtual void draw(GsOT *ot) { return; } virtual void scroll(int x, int y) { return; } protected: int backgroundColor_r, backgroundColor_g, backgroundColor_b, baseIntensity; private: }; // ------------------------------------------------------------------- class SunnyWeather : public Weather { public: SunnyWeather() : Weather(), step(0) { backgroundColor_r = 16; backgroundColor_g = 16; backgroundColor_b = 64; } virtual void act(unsigned long pad); virtual void draw(GsOT *ot); protected: private: int step; }; // ------------------------------------------------------------------- class RainyWeather : public Weather { public: RainyWeather(Image *image, Level &level); virtual void act(unsigned long pad); virtual void draw(GsOT *ot); virtual void scroll(int x, int y); protected: private: Image *image; Level &level; int intensity, count, wind; List raindrops; }; // ------------------------------------------------------------------- class Raindrop : public ActiveSprite { public: Raindrop(Image *image); virtual void draw(GsOT *ot); virtual void setSplash(bool splash) { this->splash = splash; return; } virtual bool isSplash() const { return splash; } virtual bool isGone() const { return gone; } protected: private: bool splash, gone; int step; }; // ------------------------------------------------------------------- #endif