#pragma once

#if defined(MAC)
	#include <NetworkEndpoint.h>
	#include <Participant.h>
#else
	#include "network.h"
#endif

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Application IDs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#ifdef MAC
   enum ApplicationMessageID
   {
      StateQueryMessageID = NetworkEndpoint::NextMessageID,
      CheckLoadMessageID,
		RunMissionMessageID,
      StopMissionMessageID,
      KeyCommandMessageID,
      SuspendMissionMessageID,
      ResumeMissionMessageID,
		LoadMissionMessageID,
      AbortMissionMessageID,
     	ApplicationNextMessageID
   };

	enum ApplicationID
	{
		RPL4,
		BTL4,
		BTW4
	};
	typedef	ApplicationID		ApplicationID;

	enum ExitCodeID
	{
		NullExitCodeID = 0,
      AbortExitCodeID,
		RunRedPlanetExitCodeID,
		RunBattleTechExitCodeID,
		RunSinglePlayerRedPlanetExitCodeID,
		RunSinglePlayerBattleTechExitCodeID,
		DisplayMainTestPatternExitCodeID,
		DisplayAuxTestPatternExitCodeID,
		TestPlasmaDisplayExitCodeID,
		ResetRIOExitCodeID,
		RunAudioTestExitCodeID,
		RunNortonDiskDoctorExitCodeID,
		CheckDiskUsageExitCodeID,
		RefreshRedPlanetExitCodeID,
		RefreshBattleTechExitCodeID,
		ChangeScreenModeExitCodeID,
		SoftwareResetExitCodeID,
		ClearCrashlogExitCodeID,
		KillSpoolFileExitCodeID,
		RunRedPlanetCameraExitCodeID,
		RunBattleTechCameraExitCodeID,
		RunRedPlanetMissionReviewExitCodeID,
		RunBattleTechMissionReviewExitCodeID
	};
	typedef	ExitCodeID		ExitCodeID;
#endif

	//~~~~~~~~~~~~~~~~~~~ Application__StateQueryMessage ~~~~~~~~~~~~~~~~~~~~~~~
#ifdef MAC
#pragma options align=mac68k4byte
   class Application__StateQueryMessage:
      public NetworkEndpoint::Message
   {
   public:
      Application__StateQueryMessage(HostID requesting_host);

      long
         GetRequestingHostID()
            {return requestingHost.value();}

   private:
      HostID
			requestingHost;
   };
#pragma options align=reset
#else
   class Application__StateQueryMessage:
      public NetworkClient::Message
   {
   public:
      Application__StateQueryMessage(HostID requesting_host);

      HostID
         GetRequestingHostID()
            {return requestingHost;}

   private:
      HostID
			requestingHost;
   };
#endif

   //~~~~~~~~~~~~~~~~~~~~ Application__RunMissionMessage ~~~~~~~~~~~~~~~~~~~~~~
#ifdef MAC
#pragma options align=mac68k4byte
	class Application__RunMissionMessage:
		public NetworkEndpoint::Message
	{
   public:
      Application__RunMissionMessage();
	};
#pragma options align=reset
#else
	class Application__RunMissionMessage:
		public NetworkClient::Message
	{
	public:
		Application__RunMissionMessage();
	};
#endif

	//~~~~~~~~~~~~~~~~~~~~ Application__StopMissionMessage ~~~~~~~~~~~~~~~~~~~~~
#ifdef MAC
#pragma options align=mac68k4byte
	class Application__StopMissionMessage:
		public NetworkEndpoint::Message
	{
	public:
		Application__StopMissionMessage(ExitCodeID exit_code);
		
		ExitCodeID
			GetExitCodeID()
				{return((ExitCodeID) exitCode.value());}
	
	private:
		LEDWORD
			exitCode;
	};
#pragma options align=reset
#else
	class Application__StopMissionMessage:
		public NetworkClient::Message
	{
	public:
		Application__StopMissionMessage(Enumeration exit_code);
		
		Enumeration
			GetExitCode()
				{return(exitCode);}
	
	private:
		Enumeration
			exitCode;
	};
#endif

	//~~~~~~~~~~~~~~~~~~~~ Application__AbortMissionMessage ~~~~~~~~~~~~~~~~~~~~~
#ifdef MAC
#pragma options align=mac68k4byte
	class Application__AbortMissionMessage:
		public NetworkEndpoint::Message
	{
	public:
		Application__AbortMissionMessage(ExitCodeID exit_code);
		
		ExitCodeID
			GetExitCode()
				{return((ExitCodeID) exitCode.value());}
	
	private:
		LEDWORD
			exitCode;
	};
#pragma options align=reset
#else
	class Application__AbortMissionMessage:
		public NetworkClient::Message
	{
	public:
		Application__AbortMissionMessage(Enumeration exit_code);
		
		Enumeration
			GetExitCode()
				{return(exitCode);}
	
	private:
		Enumeration
			exitCode;
	};
#endif

	//~~~~~~~~~~~~~~~~~~ Application__SuspendMissionMessage ~~~~~~~~~~~~~~~~~~~~~
#ifdef MAC
#pragma options align=mac68k4byte
	class Application__SuspendMissionMessage:
		public NetworkEndpoint::Message
	{
	public:
		Application__SuspendMissionMessage();
	};
#pragma options align=reset
#else
	class Application__SuspendMissionMessage:
		public NetworkClient::Message
	{
	public:
		Application__SuspendMissionMessage();
	};
#endif

	//~~~~~~~~~~~~~~~~~~~ Application__ResumeMissionMessage ~~~~~~~~~~~~~~~~~~~~
#ifdef MAC
#pragma options align=mac68k4byte
	class Application__ResumeMissionMessage:
		public NetworkEndpoint::Message
	{
	public:
		Application__ResumeMissionMessage();
	};
#pragma options align=reset
#else
	class Application__ResumeMissionMessage:
		public NetworkClient::Message
	{
	public:
		Application__ResumeMissionMessage();
	};
#endif
