1 /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
2 
3 #ifndef WIND_H
4 #define WIND_H
5 
6 #include <map>
7 #include <boost/noncopyable.hpp>
8 
9 #include "System/float3.h"
10 
11 class CUnit;
12 
13 class CWind : public boost::noncopyable
14 {
15 	CR_DECLARE_STRUCT(CWind)
16 
17 public:
18 	CWind();
19 	~CWind();
20 
21 	void LoadWind(float min, float max);
22 	void Update();
23 
24 	bool AddUnit(CUnit* u);
25 	bool DelUnit(CUnit* u);
26 
GetMaxWind()27 	float GetMaxWind() const { return maxWind; }
GetMinWind()28 	float GetMinWind() const { return minWind; }
GetCurrentStrength()29 	float GetCurrentStrength() const { return curStrength; }
30 
GetCurrentWind()31 	const float3& GetCurrentWind() const { return curWind; }
GetCurrentDirection()32 	const float3& GetCurrentDirection() const { return curDir; }
33 
34 private:
35 	float maxWind;
36 	float minWind;
37 	float curStrength;
38 
39 	float3 curDir;
40 	float3 curWind;
41 	float3 newWind;
42 	float3 oldWind;
43 
44 	int status;
45 
46 	std::map<int, CUnit*> windGens;
47 };
48 
49 extern CWind wind;
50 
51 #endif /* WIND_H */
52