Code Search for Developers
 
 
  

Weather.h from palisma2d at Krugle


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

palisma2d

The University of Wisconsin-Parkside Developers Union first product. More info to come. Code name Palisma.

Project homepage: http://code.google.com/p/palisma2d/
Programming language(s): C,C++
License: gpl2

  DialogModel.cpp
  DialogModel.h
  DialogState.cpp
  DialogState.h
  Enemy.cpp
  Enemy.h
  EntityController.cpp
  EntityController.h
  EntityEvents.cpp
  EntityEvents.h
  EntityFactory.cpp
  EntityFactory.h
  EntityManager.cpp
  EntityManager.h
  EntityStates.cpp
  EntityStates.h
  Event.h
  HUD.cpp
  HUD.h
  IEntity.cpp
  IEntity.h
  IWeapon.cpp
  IWeapon.h
  InGameState.cpp
  InGameState.h
  Inventory.cpp
  Inventory.h
  MissionHolder.cpp
  MissionHolder.h
  Player.cpp
  Player.h
  PlayerConfig.cpp
  PlayerConfig.h
  PlayerController.cpp
  PlayerController.h
  QuestImporter.cpp
  QuestImporter.h
  ReadMe.txt
  Scene.cpp
  Scene.h
  Shotgun.cpp
  Shotgun.h
  State.h
  StateFactory.cpp
  StateFactory.h
  StateMachine.cpp
  StateMachine.h
  Tile.cpp
  Tile.h
  Weather.cpp
  Weather.h
  stdafx.cpp
  stdafx.h