/src/game/landscape/C4Weather.h

https://bitbucket.org/randrian/openclonk2 · C Header · 64 lines · 40 code · 5 blank · 19 comment · 0 complexity · 81d4dcb9c4c5a0dd0ba1bc86709e46a2 MD5 · raw file

  1. /*
  2. * OpenClonk, http://www.openclonk.org
  3. *
  4. * Copyright (c) 1998-2000 Matthes Bender
  5. * Copyright (c) 2001, 2005 Sven Eberhardt
  6. * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de
  7. *
  8. * Portions might be copyrighted by other authors who have contributed
  9. * to OpenClonk.
  10. *
  11. * Permission to use, copy, modify, and/or distribute this software for any
  12. * purpose with or without fee is hereby granted, provided that the above
  13. * copyright notice and this permission notice appear in all copies.
  14. * See isc_license.txt for full license and disclaimer.
  15. *
  16. * "Clonk" is a registered trademark of Matthes Bender.
  17. * See clonk_trademark_license.txt for full license.
  18. */
  19. /* Controls temperature, wind, and natural disasters */
  20. #ifndef INC_C4Weather
  21. #define INC_C4Weather
  22. #include <C4Landscape.h>
  23. class C4Weather
  24. {
  25. public:
  26. C4Weather();
  27. ~C4Weather();
  28. public:
  29. int32_t Season,YearSpeed,SeasonDelay;
  30. int32_t Wind,TargetWind;
  31. int32_t Temperature,TemperatureRange,Climate;
  32. int32_t MeteoriteLevel,VolcanoLevel,EarthquakeLevel,LightningLevel;
  33. int32_t NoGamma;
  34. public:
  35. void Default();
  36. void Clear();
  37. void Execute();
  38. void SetClimate(int32_t iClimate);
  39. void SetSeason(int32_t iSeason);
  40. void SetTemperature(int32_t iTemperature);
  41. void Init(bool fScenario);
  42. void SetWind(int32_t iWind);
  43. int32_t GetWind(int32_t x, int32_t y);
  44. int32_t GetTemperature();
  45. int32_t GetSeason();
  46. int32_t GetClimate();
  47. bool LaunchLightning(int32_t x, int32_t y, int32_t xdir, int32_t xrange, int32_t ydir, int32_t yrange, bool fDoGamma);
  48. bool LaunchVolcano(int32_t mat, int32_t x, int32_t y, int32_t size);
  49. bool LaunchEarthquake(int32_t iX, int32_t iY);
  50. bool LaunchCloud(int32_t iX, int32_t iY, int32_t iWidth, int32_t iStrength, const char *szPrecipitation);
  51. void SetSeasonGamma(); // set gamma adjustment for season
  52. void CompileFunc(StdCompiler *pComp);
  53. };
  54. extern C4Weather Weather;
  55. inline int32_t GBackWind(int32_t x, int32_t y)
  56. {
  57. return GBackIFT(x, y) ? 0: ::Weather.Wind;
  58. }
  59. #endif