1 ////////////////////////////////////////////////////////////////////////////////
2 //    Scorched3D (c) 2000-2011
3 //
4 //    This file is part of Scorched3D.
5 //
6 //    Scorched3D is free software; you can redistribute it and/or modify
7 //    it under the terms of the GNU General Public License as published by
8 //    the Free Software Foundation; either version 2 of the License, or
9 //    (at your option) any later version.
10 //
11 //    Scorched3D is distributed in the hope that it will be useful,
12 //    but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 //    GNU General Public License for more details.
15 //
16 //    You should have received a copy of the GNU General Public License along
17 //    with this program; if not, write to the Free Software Foundation, Inc.,
18 //    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 ////////////////////////////////////////////////////////////////////////////////
20 
21 #if !defined(AFX_TANKET_H__52F37177_46EA_49C8_9B58_E6C57ABDB78A__INCLUDED_)
22 #define AFX_TANKET_H__52F37177_46EA_49C8_9B58_E6C57ABDB78A__INCLUDED_
23 
24 #include <target/Target.h>
25 
26 class TankAI;
27 class TanketType;
28 class TanketShotInfo;
29 class TanketAccessories;
30 class Tanket : public Target
31 {
32 public:
33 	// Constructor for tanket
34 	Tanket(ScorchedContext &context,
35 		unsigned int playerId,
36 		const LangString &name);
37 	virtual ~Tanket();
38 
getType()39 	virtual TargetType getType() { return Target::TypeTanket; }
40 
41 	// Called when the state changes
42 	virtual void newMatch();
43 	virtual void newGame();
44 
45 	// Serialize the tanket
46 	virtual bool writeMessage(NamedNetBuffer &buffer);
47 	virtual bool readMessage(NetBufferReader &reader);
48 
getTankAI()49 	TankAI *getTankAI() { return tankAI_; }
50 	void setTankAI(TankAI *ai);
getTeam()51 	unsigned int getTeam() { return team_; }
setTeam(unsigned int team)52 	void setTeam(unsigned int team) { team_ = team; }
53 
setTanketType(TanketType * type)54 	void setTanketType(TanketType *type) { tanketType_ = type; }
getTanketType()55 	TanketType *getTanketType() { return tanketType_; }
getAccessories()56 	TanketAccessories& getAccessories() { return *accessories_; }
getShotInfo()57 	TanketShotInfo& getShotInfo() { return *shotInfo_; }
58 
59 protected:
60 	ScorchedContext &context_;
61 	TanketAccessories *accessories_;
62 	TanketShotInfo *shotInfo_;
63 	TanketType *tanketType_;
64 	TankAI *tankAI_;
65 	unsigned int team_;
66 
67 };
68 
69 #endif // !defined(AFX_TANKET_H__52F37177_46EA_49C8_9B58_E6C57ABDB78A__INCLUDED_)
70