#pragma once

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

	//~~~~~~~~~~~~~~~~~~~~~~~~ Console Message IDs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	enum ConsoleMessageID
	{
		ConsoleApplicationReadyToRunMessageID = 0,
		ConsoleApplicationStateResponseMessageID = 1,
		ConsoleApplicationEndMissionMessageID = 7,
		ConsoleApplicationAbortMissionMessageID = 11,
		ConsoleApplicationTeamEndMissionMessageID = 14
	};

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

		long
			GetReadyToRunHostID()
				{return readyToRunHostID.value();}

	private:
		HostID
			readyToRunHostID;
	};
#pragma options align=reset
#else
	class ConsoleApplicationReadyToRunMessage:
		public NetworkClient::Message
	{
	public:
		ConsoleApplicationReadyToRunMessage(HostID ready_to_run_host_ID);

		HostID
			GetReadyToRunHostID()
				{return readyToRunHostID;}

	private:
		HostID
			readyToRunHostID;
	};
#endif

	//~~~~~~~~~~~~~~~~ ConsoleApplicationStateResponseMessage ~~~~~~~~~~~~~~~~~~
#ifdef MAC
#pragma options align=mac68k4byte
	class ConsoleApplicationStateResponseMessage:
		public NetworkEndpoint::Message
	{
	public:
		ConsoleApplicationStateResponseMessage(
      	HostID responding_host_ID,
         LEDWORD application_state,
      	LEDWORD application_type
      );

      long
         GetRespondingHostID()
            {return respondingHostID.value();}
      long
			GetApplicationState()
            {return applicationState.value();}
		ApplicationID
			GetApplication()
				{return((ApplicationID) application.value());}

   private:
      HostID
         respondingHostID;
		LEDWORD
      	applicationState;
      LEDWORD
      	application;
	};
#pragma options align=reset
#else
	class ConsoleApplicationStateResponseMessage:
		public NetworkClient::Message
	{
	public:
		ConsoleApplicationStateResponseMessage(
      	HostID responding_host_ID,
         Enumeration application_state,
      	Enumeration application
      );

      HostID
         GetRespondingHostID()
            {return respondingHostID;}
      Enumeration
			GetApplicationState()
            {return applicationState;}
      Enumeration
      	GetApplication()
      		{return application;}

   private:
      HostID
         respondingHostID;
		Enumeration
      	applicationState;
      Enumeration
      	application;
   };
#endif

	//~~~~~~~~~~~~~~~~~~ ConsoleApplicationEndMissionMessage ~~~~~~~~~~~~~~~~~~~
#ifdef MAC
#pragma options align=mac68k4byte
	class ConsoleApplicationEndMissionMessage:
		public NetworkEndpoint::Message
	{
	public:
		ConsoleApplicationEndMissionMessage(
			HostID player_ID,
			LEDWORD final_score
		);

		long
			GetPlayerHostID()
				{return playerHostID.value();}
		long
			GetFinalScore()
				{return finalScore.value();}

	private:
		HostID
			playerHostID;
		LEDWORD
			finalScore;
	};
#pragma options align=reset
#else
	class ConsoleApplicationEndMissionMessage:
		public NetworkClient::Message
	{
	public:
		ConsoleApplicationEndMissionMessage(
			HostID player_host_ID,
			int final_score
		);

		HostID
			GetPlayerHostID()
				{return playerHostID;}
		int
			GetFinalScore()
				{return finalScore;}

	private:
		HostID
			playerHostID;
		int
			finalScore;
	};
#endif

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

		long
			GetPlayerHostID()
				{return playerHostID.value();}

	private:
		HostID
			playerHostID;
	};
#pragma options align=reset
#else
	class ConsoleApplicationAbortMissionMessage:
		public NetworkClient::Message
	{
	public:
		ConsoleApplicationAbortMissionMessage(
			HostID player_host_ID
		);

		HostID
			GetPlayerHostID()
				{return playerHostID;}

	private:
		HostID
			playerHostID;
	};
#endif

	//~~~~~~~~~~~~~~~~ ConsoleApplicationTeamEndMissionMessage ~~~~~~~~~~~~~~~~~
#ifdef MAC
#pragma options align=mac68k4byte
	class ConsoleApplicationTeamEndMissionMessage:
		public NetworkEndpoint::Message
	{
	public:
		ConsoleApplicationTeamEndMissionMessage(
			HostID player_ID,
			LEDWORD player_score,
			LEDWORD team_id,
			LEDWORD team_score
		);

		long
			GetPlayerHostID()
				{return playerHostID.value();}
		long
			GetPlayerScore()
				{return playerScore.value();}
		long
			GetTeamID()
				{return teamID.value();}
		long
			GetTeamScore()
				{return teamScore.value();}

	private:
		HostID
			playerHostID;
		LEDWORD
			playerScore;
		LEDWORD
			teamID;
		LEDWORD
			teamScore;
	};
#pragma options align=reset
#else
	class ConsoleApplicationTeamEndMissionMessage:
		public NetworkClient::Message
	{
	public:
		ConsoleApplicationTeamEndMissionMessage(
			HostID player_host_ID,
			int player_score,
			int team_id,
			int team_score
		);

		HostID
			GetPlayerHostID()
				{return playerHostID;}
		int
			GetFinalScore()
				{return playerScore;}
		int
			GetTeamID()
				{return teamID;}
		int
			GetTeamScore()
				{return teamScore;}

	private:
		HostID
			playerHostID;
		int
			playerScore;
		int
			teamID;
		int
			teamScore;
	};
#endif
