//===========================================================================//
// File:	gaugalrm.hpp                                                        //
// Project: MUNGA           Brick: Gauge Renderer Manager	                 //
// Contents: 																					  //
//---------------------------------------------------------------------------//
//   Date    Who  Modification                                               //
// --------  ---  ---------------------------------------------------------- //
// 02/22/96  CPB  Initial coding.                                            //
//---------------------------------------------------------------------------//
// Copyright (C) 1996, Virtual World Entertainment, Inc. All rights reserved //
//                      PROPRIETARY and CONFIDENTIAL                         //
//===========================================================================//

#if !defined(GAUGALRM_HPP)
#	define GAUGALRM_HPP

	class GaugeAlarm;
	class GaugeAlarmManager;

#	if !defined(RESOURCE_HPP)
#		include <resource.hpp>
#	endif

#	if !defined(CHAIN_HPP)
#		include <chain.hpp>
#	endif

#	if !defined(LAMP_HPP)
#		include <lamp.hpp>
#	endif

	//#######################################################################
	// GaugeAlarm
	//#######################################################################
	class GaugeAlarm :
		public Node
	{
		friend class GaugeAlarmManager;

	protected:
		GaugeAlarm(
			Entity *entity,
			Subsystem *subsystem,
			Enumeration condition
		);

		~GaugeAlarm();

	public:
		Logical
			TestInstance() const;
	protected:
		Entity
			*entity;
		Subsystem
			*subsystem;
		int
			conditionIndex;
	public:
		ChainOf<Lamp*>		// descendants of GaugeAlarmManager need to see this
			lampList;
	};
					 
	//#######################################################################
	// GaugeAlarmManager
	//#######################################################################
	class GaugeAlarmManager SIGNATURED
	{
		friend class GaugeAlarm;
		friend class GaugeRenderer;
	protected:
		GaugeAlarmManager();
	public:
		virtual ~GaugeAlarmManager();
		//--------------------------------------------------------------------
		// Resource methods
		//--------------------------------------------------------------------
	public:
		ResourceDescription::ResourceID
			CreateModelGaugeAlarmStreamResource(
				ResourceFile *resource_file,
				const char *model_name,
				NotationFile *model_file,
				const ResourceDirectories */*directories*/
			);

		virtual Logical
			CreateGaugeAlarmStreamItem(
				MemoryStream *mem_stream,
				const char *alarm_name,
				const char *alarm_data
			);
		virtual void
			ReadGaugeAlarmStreamItem(
				GaugeAlarm *alarm,
				Entity *the_entity,
				Subsystem *the_subsystem,
				Enumeration the_condition,
				MemoryStream *mem_stream
			);

		void
			RemoveAllAlarms();
		void
			Activate(
				Entity *entity,
				Subsystem *subsystem,
				Enumeration condition,
				ResourceDescription::ResourceID resource_ID
			);
		void
			Deactivate(
				Entity *entity,
				Subsystem *subsystem,
				Enumeration condition
			);

	public:
		Logical
			TestInstance() const;

	protected:
		ChainOf<GaugeAlarm*>
			gaugeAlarmList;
	};

#endif

