1 #ifndef E323_TASKBUILD_H
2 #define E323_TASKBUILD_H
3 
4 #include "../ATask.h"
5 
6 struct UnitType;
7 
8 struct BuildTask: public ATask {
BuildTaskBuildTask9 	BuildTask(AIClasses *_ai): ATask(_ai) { t = TASK_BUILD; }
10 	BuildTask(AIClasses *_ai, buildType build, UnitType *toBuild, CGroup &group, float3 &pos);
11 
12 	/* Build type to string */
13 	static std::map<buildType, std::string> buildStr;
14 
15 	bool building;
16 	/* The build task */
17 	buildType bt;
18 	/* The ETA in frames */
19 	unsigned int eta;
20 	/* The UnitType to build */
21 	UnitType* toBuild;
22 
23 	/* overload */
24 	void onUpdate();
25 	/* overload */
26 	bool onValidate();
27 	/* overload */
28 	void toStream(std::ostream& out) const;
29 	/* overload */
30 	void onUnitDestroyed(int uid, int attacker);
31 
32 	bool assistable(CGroup &group, float &travelTime) const;
33 };
34 
35 #endif
36