BattleTech egg builder, catalog, and golden-egg DiffTests (BT port phases 1-2)
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>
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
|
||||
namespace TeslaConsole.BattleTech;
|
||||
|
||||
public class BTMap
|
||||
{
|
||||
private readonly string mKey;
|
||||
|
||||
private readonly string mName;
|
||||
|
||||
private readonly string mImagePath;
|
||||
|
||||
public string Key => mKey;
|
||||
|
||||
public string Name => mName;
|
||||
|
||||
public Image Image
|
||||
{
|
||||
get
|
||||
{
|
||||
if (mImagePath == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return ImageCache.GetImage(Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), mImagePath));
|
||||
}
|
||||
}
|
||||
|
||||
internal BTMap(XmlNode mapNode)
|
||||
{
|
||||
XmlAttribute xmlAttribute = mapNode.Attributes["image"];
|
||||
mKey = mapNode.Attributes["key"].InnerText;
|
||||
mName = mapNode.Attributes["name"].InnerText;
|
||||
mImagePath = xmlAttribute?.InnerText;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return mName;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user