1 /* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */
2 #ifndef IPATHDRAWER_HDR
3 #define IPATHDRAWER_HDR
4 
5 #include "System/Color.h"
6 #include "System/EventClient.h"
7 
8 struct MoveDef;
9 
10 struct IPathDrawer: public CEventClient {
11 public:
12 	IPathDrawer();
13 
14 	virtual ~IPathDrawer();
DrawAllIPathDrawer15 	virtual void DrawAll() const {}
DrawInMiniMapIPathDrawer16 	virtual void DrawInMiniMap() {}
17 
UpdateExtraTextureIPathDrawer18 	virtual void UpdateExtraTexture(int, int, int, int, unsigned char*) const {}
19 
20 	// CEventClient interface
WantsEventIPathDrawer21 	bool WantsEvent(const std::string& eventName) {
22 		return (eventName == "DrawInMiniMap");
23 	}
24 
ToggleEnabledIPathDrawer25 	bool ToggleEnabled() { enabled = !enabled; return enabled; }
IsEnabledIPathDrawer26 	bool IsEnabled() const { return enabled; }
27 
28 	static IPathDrawer* GetInstance();
29 	static void FreeInstance(IPathDrawer*);
30 
31 	static const MoveDef* GetSelectedMoveDef();
32 	static SColor GetSpeedModColor(const float sm);
33 	static float GetSpeedModNoObstacles(const MoveDef* md, int sqx, int sqz);
34 
35 protected:
36 	bool enabled;
37 };
38 
39 extern IPathDrawer* pathDrawer;
40 
41 #endif
42 
43