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(__INCLUDE_OptionsTransienth_INCLUDE__)
22 #define __INCLUDE_OptionsTransienth_INCLUDE__
23 
24 #include <common/Vector.h>
25 #include <common/OptionsScorched.h>
26 #include <net/NetBuffer.h>
27 
28 class TargetContainer;
29 class OptionsTransient
30 {
31 public:
32 	OptionsTransient(OptionsScorched &optionsGame);
33 	virtual ~OptionsTransient();
34 
35 	unsigned int getLeastUsedTeam(TargetContainer &container);
36 
37 	enum WallType
38 	{
39 		wallConcrete = 0,
40 		wallBouncy = 1,
41 		wallWrapAround = 2,
42 		wallNone = 3
43 	};
44 	enum WallSide
45 	{
46 		LeftSide = 0,
47 		RightSide,
48 		TopSide,
49 		BotSide
50 	};
51 
52 	void reset();
53 	void newGame();
54 
55 	void startNewGame();
56 
57 	// Walls
getWallType()58 	WallType getWallType() { return (WallType) wallType_.getValue(); }
59 	Vector &getWallColor();
60 
61 	// Rounds left
getCurrentRoundNo()62 	int getCurrentRoundNo() { return currentRoundNo_.getValue(); }
setCurrentRoundNo(int round)63 	void setCurrentRoundNo(int round) { currentRoundNo_.setValue(round); }
64 
getCurrentTurnNo()65 	int getCurrentTurnNo() { return currentTurnNo_.getValue(); }
setCurrentTurnNo(int round)66 	void setCurrentTurnNo(int round) { currentTurnNo_.setValue(round); }
67 
68 	// Arms Level
69 	int getArmsLevel();
70 
71 	// Used to send this structure over coms
72 	bool writeToBuffer(NetBuffer &buffer);
73 	bool readFromBuffer(NetBufferReader &reader);
74 
getOptions()75 	std::list<OptionEntry *> &getOptions() { return options_; }
76 
77 protected:
78 	std::list<OptionEntry *> options_;
79 	OptionsScorched &optionsGame_;
80 	OptionEntryInt currentRoundNo_, currentTurnNo_;
81 	OptionEntryInt wallType_;
82 
83 	bool newGame_;
84 	void newGameWall();
85 
86 };
87 
88 #endif
89