WorldSim  inDev
2D tile-based sandbox RPG with procedurally generated fantasy world simulator 🌏
World_Viewer_Rain_Manager.hpp
Go to the documentation of this file.
1 #pragma once
2 #ifndef WORLDSIM_WORLD_VIEWER_RAIN_MANAGER_HPP
3 #define WORLDSIM_WORLD_VIEWER_RAIN_MANAGER_HPP
4 
5 /* WorldSim: WorldViewer Rain Manager
6  #include "World_Viewer_Rain_Manager.hpp"
7 
8  Controls rendering of rain.
9 */
10 
11 #include <Container/Vector/Vector.hpp>
12 //#include "RandomNonStatic.hpp" // Assuming RandomNonStatic is a custom class that needs to be included.
13 //#include "World.hpp" // Assuming World is a custom class that needs to be included.
14 // Add other necessary includes here
15 
16 // Raindrops that are rendered over screen to indicate rain.
17 // Should start at top of screen and travel down. Should not render on sheltered tiles
18 class RainDrop
19 {
20 public:
21  int x, y;
22 
23  RainDrop();
24  void drop(int amount);
25  void render();
26 };
27 
29 {
30 private:
31  RandomNonStatic rand;
32  Vector<RainDrop*> vRainDrop;
33  World* world;
34  int x1, x2;
35  int y1, y2;
36  int MAX_RAIN;
37  int RAIN_PER_FRAME;
38 
39 public:
40  RainManager();
41  void init(int _x1, int _y1, int _x2, int _y2, World* _world, int _maxRain=10000, double _rainPercentOfX=0.005);
42  void updateRain();
43  void render();
44 };
45 
46 #endif // WORLDSIM_WORLD_VIEWER_RAIN_MANAGER_HPP
Definition: World_Viewer_Rain_Manager.hpp:28
void drop(int amount)
Definition: World_Viewer_Rain_Manager.cpp:14
Definition: World_Viewer_Rain_Manager.hpp:18
Definition: World.hpp:50
World world
Definition: Driver.cpp:45
int x
Definition: World_Viewer_Rain_Manager.hpp:21
RainDrop()
Definition: World_Viewer_Rain_Manager.cpp:8
void init()
Definition: Driver_Init.hpp:16
void render()
Definition: World_Viewer_Rain_Manager.cpp:19
int y
Definition: World_Viewer_Rain_Manager.hpp:21