New TeslaConsole.BattleTech namespace mirroring TeslaConsole.RedPlanet's mission layer: BTMission/BTFreeForAllMission (egg serializer; RP wire framing and ordinal bitmaps reused verbatim), BTParticipant/BTPlayer/BTCamera (BT participant fields: advancedDamage, experience, vehicleValue, patch, role), and the BTConfig/BTScenario/BTMap/BTVehicle/BTWeather/BTRole catalog loaded from BattleTech\BTConfig.xml (reconstructed from the Mac Console 4.10 ini BT tree). Free For All and No Return share one mission class - both send scenario=freeforall; the mode is the role assigned to each pilot. BTGoldenEggTests (7 tests, recovered-only) diff the generated egg field-by-field against two eggs captured from the original consoles (cavern.egg, TESTARN.EGG): order-independent per-section compare with font-rendered bitmap pixel rows excluded, ordinal art byte-exact vs TESTARN.EGG, EggFileMessage framing reassembly, role de-dup, No Return role semantics, and shipped-catalog contents. Invoker gains BTEggString/ BTEggFraming reflection cases. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
32 lines
731 B
C#
32 lines
731 B
C#
using System;
|
|
using System.Text;
|
|
|
|
namespace TeslaConsole.BattleTech;
|
|
|
|
[Serializable]
|
|
internal abstract class BTParticipant
|
|
{
|
|
private readonly string mPodHostAddress;
|
|
|
|
private readonly HostType mHostType;
|
|
|
|
public string PodHostAddress => mPodHostAddress;
|
|
|
|
public HostType HostType => mHostType;
|
|
|
|
protected BTParticipant(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);
|
|
}
|