Files
TeslaSuite/Console/TeslaConsole.RedPlanet/RPPlayer.cs
T
CydandClaude Opus 4.8 548550b312 Initial commit: TeslaSuite monorepo (TeslaConsole + TeslaLauncher)
Co-locate the two cockpit-pod projects into a single repository:

- Console/  : TeslaConsole, the net48 WinForms operator console (decompiled
              reconstruction) plus its differential + catalog test suite.
- Launcher/ : TeslaLauncher, the net6 pod-side Service + Agent rewrite.

Adds a combined TeslaSuite.sln, root README documenting the shared wire
contract (and its current duplication, the main follow-up), and a root
.gitignore. Histories were not preserved per request; this is a fresh start
from the current working state of both projects.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 14:43:28 -05:00

68 lines
1.6 KiB
C#

using System;
using System.Text;
namespace TeslaConsole.RedPlanet;
[Serializable]
internal abstract class RPPlayer : RPParticipant
{
private readonly string mName;
private readonly string mVehicleKey;
private readonly string mColorKey;
private readonly string mBadgeKey;
public string Name => mName;
public string VehicleKey => mVehicleKey;
public string ColorKey => mColorKey;
public string BadgeKey => mBadgeKey;
protected RPPlayer(string podHostAddress, string name, string vehicleKey, string colorKey, string badgeKey)
: base(podHostAddress, HostType.GameMachineHostType)
{
if (podHostAddress == null)
{
throw new ArgumentNullException("podHostAddress");
}
if (name == null)
{
throw new ArgumentNullException("name");
}
if (vehicleKey == null)
{
throw new ArgumentNullException("vehicleKey");
}
if (colorKey == null)
{
throw new ArgumentNullException("colorKey");
}
if (badgeKey == null)
{
throw new ArgumentNullException("badgeKey");
}
mName = name;
mVehicleKey = vehicleKey;
mColorKey = colorKey;
mBadgeKey = badgeKey;
}
protected sealed override void AppendParticipantSpecificData(int index, StringBuilder sb)
{
sb.Append("dropzone=one\n");
sb.AppendFormat("name={0}\n", mName);
sb.AppendFormat("bitmapindex={0}\n", index);
sb.Append("loadzones=1\n");
sb.AppendFormat("vehicle={0}\n", mVehicleKey);
sb.AppendFormat("color={0}\n", mColorKey);
sb.AppendFormat("badge={0}\n", mBadgeKey);
AppendMissionSpecificPilot(index, sb);
}
protected abstract void AppendMissionSpecificPilot(int index, StringBuilder sb);
}