1 //       _________ __                 __
2 //      /   _____//  |_____________ _/  |______     ____  __ __  ______
3 //      \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
4 //      /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ |
5 //     /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
6 //             \/                  \/          \//_____/            \/
7 //  ______________________                           ______________________
8 //                        T H E   W A R   B E G I N S
9 //         Stratagus - A free fantasy real time strategy game engine
10 //
11 /**@name action_research.h - The actions headerfile. */
12 //
13 //      (c) Copyright 1998-2012 by Lutz Sammer and Jimmy Salmon
14 //
15 //      This program is free software; you can redistribute it and/or modify
16 //      it under the terms of the GNU General Public License as published by
17 //      the Free Software Foundation; only version 2 of the License.
18 //
19 //      This program is distributed in the hope that it will be useful,
20 //      but WITHOUT ANY WARRANTY; without even the implied warranty of
21 //      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22 //      GNU General Public License for more details.
23 //
24 //      You should have received a copy of the GNU General Public License
25 //      along with this program; if not, write to the Free Software
26 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
27 //      02111-1307, USA.
28 //
29 
30 #ifndef __ACTION_RESEARCH_H__
31 #define __ACTION_RESEARCH_H__
32 
33 #include "actions.h"
34 
35 //@{
36 
37 class COrder_Research : public COrder
38 {
39 public:
COrder_Research()40 	COrder_Research() : COrder(UnitActionResearch), Upgrade(NULL) {}
41 
Clone()42 	virtual COrder_Research *Clone() const { return new COrder_Research(*this); }
43 
44 	virtual bool IsValid() const;
45 
46 	virtual void Save(CFile &file, const CUnit &unit) const;
47 	virtual bool ParseSpecificData(lua_State *l, int &j, const char *value, const CUnit &unit);
48 
49 	virtual void Execute(CUnit &unit);
50 	virtual void Cancel(CUnit &unit);
51 	virtual PixelPos Show(const CViewport &vp, const PixelPos &lastScreenPos) const;
UpdatePathFinderData(PathFinderInput & input)52 	virtual void UpdatePathFinderData(PathFinderInput &input) { UpdatePathFinderData_NotCalled(input); }
53 
54 	virtual void UpdateUnitVariables(CUnit &unit) const;
55 
GetUpgrade()56 	const CUpgrade &GetUpgrade() const { return *Upgrade; }
SetUpgrade(CUpgrade & upgrade)57 	void SetUpgrade(CUpgrade &upgrade) { Upgrade = &upgrade; }
58 private:
59 	CUpgrade *Upgrade;
60 };
61 
62 //@}
63 
64 #endif // !__ACTION_RESEARCH_H__
65