/*****************************************************************************
 * $Id: game_base_config.hh,v 1.5 2006/08/03 02:17:21 devel Exp $
 * @file
 * @author	Jim E. Brooks  http://www.jimbrooks.org
 * @brief	Configuration, load/state state.
 *//*
 * LEGAL:	COPYRIGHT (C) 2004 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE (GPL).
 *****************************************************************************/

#if COMPILING_GAME
#ifndef GAME_BASE_CONFIG_HH
#define GAME_BASE_CONFIG_HH 1

// Key common to all game modules but values are specific.
const string cfgkey_game_module = "game_module";

/// A Dyna's config state is interimly loaded into this struct
/// because LoadState() is called before the game creates Dyna/Craft objects.
class DynaConfigState
{
			PREVENT_COPYING(DynaConfigState)
public:
			DynaConfigState( void );
	void	LoadDyna( Dyna& dyna );
	void	SetXm( const MatrixExt& xm );
	void	SetChasePlaneDistance( double chasePlaneDistance );
	void	SetControlResponse( Percent controlResponse );

private:
	bool        mXmValid;
	MatrixExt   mXm;
	bool        mChasePlaneDistanceValid;
	double      mChasePlaneDistance;
	bool        mControlResponseValid;
	Percent     mControlResponse;
};

void
ConfigSaveDyna( ConfigFile& config, const string& prefix, const Dyna& dyna, double chaseDist );

void
ConfigLoadDyna( ConfigFile& config, const string& prefix, DynaConfigState& dynaConfigState );

void
ConfigCopyMatrix( MatrixExt& dest, const Dyna& dyna );

#endif // GAME_BASE_CONFIG_HH
#endif // COMPILING_GAME
