using System;
using System.Text;

namespace TeslaConsole.RedPlanet;

[Serializable]
internal abstract class RPParticipant
{
	private readonly string mPodHostAddress;

	private readonly HostType mHostType;

	public string PodHostAddress => mPodHostAddress;

	public HostType HostType => mHostType;

	protected RPParticipant(string podHostAddress, HostType hostType)
	{
		mPodHostAddress = podHostAddress;
		mHostType = hostType;
	}

	public void AppendParticipant(int index, StringBuilder sb)
	{
		sb.AppendFormat("[{0}]\n", mPodHostAddress);
		sb.AppendFormat("hostType={0}\n", (int)mHostType);
		AppendParticipantSpecificData(index, sb);
	}

	protected abstract void AppendParticipantSpecificData(int index, StringBuilder sb);
}
