Show Weather.h syntax highlighted
#pragma once
#include "../shared/color.h"
#include "../Console.h"
/**
==========================
Lightning Type
==========================
*/
enum eLightningType
{
LT_SMALL = 7,
LT_MED = 8,
LT_BIG = 31,
LT_NOTHING = 0
};
/** Rain command */
class Weather;
class Rain_f : public ICommand
{
public:
Rain_f() { m_weather = NULL; };
void Exec(std::string &s);
void Set(Weather* w) { m_weather = w; };
~Rain_f() {};
private:
Weather* m_weather;
};
class RainTime_f : public ICommand
{
public:
RainTime_f() { m_weather = NULL; };
void Exec(std::string &s);
void Set(Weather* w) { m_weather = w; };
~RainTime_f() {};
private:
Weather* m_weather;
};
/**
=========================
Handles weather effects
such as rain, snow, nightfall,
and daylight
=========================
*/
class Weather
{
public:
Weather(void);
/** Get the Time of day in hours */
float GetTimeOfDay();
void SetNextDayTime(float d) { m_nextDayTime = d; };
/** Set Rain */
void EnableRain(bool b) { m_rain = b; };
/** Check Raining */
bool IsRaining() { return m_rain; };
/** Check Lightning */
int CheckLightning();
/** Enable fog */
void EnableFog(bool b) { m_fog = b; };
/** check fog */
bool IsFogEnabled() { return m_fog; };
/** Set fog color */
void SetFogColor( int r, int g, int b, int a=1);
/** Get fog color */
Color GetFogColor() { return m_fColor; };
private:
// rain
bool m_rain;
// fog
bool m_fog;
// fog color
Color m_fColor;
// old time
float m_nextDayTime;
// am to pm
bool m_lap;
// next possible lightining
float m_nextLightning;
int m_type;
// console command for toggling rain
Rain_f rain_f;
RainTime_f rainTime_f;
public:
virtual ~Weather(void);
};
See more files for this project here