//===========================================================================//
// File:	subsystm.hh                                                         //
// Project: MUNGA           Brick: Entity Manager                            //
// Contents: Interface specification of entity subsystem class               //
//---------------------------------------------------------------------------//
//   Date    Who  Modification                                               //
// --------  ---  ---------------------------------------------------------- //
// 01/24/95  JMA  Initial coding.                                            //
//---------------------------------------------------------------------------//
// Copyright (C) 1995, Virtual World Entertainment, Inc. All Rights reserved //
//                      PROPRIETARY AND CONFIDENTIAL                         //
//===========================================================================//

#if !defined(VTVSUB_HPP)
#	define VTVSUB_HPP

#	if !defined(SUBSYSTM_HPP)
#		include <subsystm.hpp>
#	endif

#	if !defined(CONTROLS_HPP)
#		include <controls.hpp>
#	endif

	class VTV;

	//##########################################################################
	//########################    Subsystem    #################################
	//##########################################################################

	class VTVSubsystem:
		public Subsystem
	{
		friend class VTV;

	//##########################################################################
	// Shared Data Support
	//
	public:
		static Derivation ClassDerivations;
		static SharedData DefaultData;

	//##########################################################################
	// Messaging support
	//

	// No messages handled here

	//##########################################################################
	// Construction and Destruction Support
	//
	public:
		~VTVSubsystem();

		Logical
			TestInstance() const;

	protected:
		VTVSubsystem(
			VTV *entity,
			int subsystem_id,
			SubsystemResource *model,
			SharedData &shared_data,
						// these two fields added 12-28-95 by cpb
			void *control_destination = NULL,
			Receiver::MessageID message_id = (Receiver::MessageID) 0
		);

	//##########################################################################
	// Model support
	//
	public:
		VTV*
			GetEntity()
				{return (VTV*)Subsystem::GetEntity();}

	//##########################################################################
	// Mapping support
	//
	protected:
		void
			EnterConfiguration(
				ControlsButton *direct_target,
				Receiver *receiver,
				Receiver::MessageID active_message_id,
				Receiver::MessageID config_message_id
			),
			ExitConfiguration();

		// 'controlDestination' is a pointer to the "thing" that a button
		// is mapped to (if 'direct-mapped'), and 'controlMessageID' indicates
		// the message ID that the button is mapped to (if 'event-mapped').
		// These values must be set appropriately in order for gauges to be
		// able to determine ownership of mapped buttons.
		void
			*controlDestination;		// OBSOLETE?

		Receiver::MessageID			// OBSOLETE?
			controlMessageID;
	};

#endif
