ui/phase-17: ship-class CRUD without calc
Phase 17 lights up the ship-class table and designer active views, extends the order-draft pipeline with createShipClass and removeShipClass commands, and projects pending Save/Delete actions through applyOrderOverlay so the table reflects the player's intent before auto-sync lands. The plan is corrected in the same patch: per game/rules.txt, ship classes are designed once and cannot be edited — the engine has no Update command, so the UI exposes only Create + Delete. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,8 @@ import {
|
||||
CommandPlanetRename,
|
||||
CommandPlanetRouteRemove,
|
||||
CommandPlanetRouteSet,
|
||||
CommandShipClassCreate,
|
||||
CommandShipClassRemove,
|
||||
PlanetProduction,
|
||||
PlanetRouteLoadType,
|
||||
UserGamesOrderGet,
|
||||
@@ -197,6 +199,29 @@ function decodeCommand(item: CommandItemView): OrderCommand | null {
|
||||
loadType,
|
||||
};
|
||||
}
|
||||
case CommandPayload.CommandShipClassCreate: {
|
||||
const inner = new CommandShipClassCreate();
|
||||
item.payload(inner);
|
||||
return {
|
||||
kind: "createShipClass",
|
||||
id,
|
||||
name: inner.name() ?? "",
|
||||
drive: inner.drive(),
|
||||
armament: Number(inner.armament()),
|
||||
weapons: inner.weapons(),
|
||||
shields: inner.shields(),
|
||||
cargo: inner.cargo(),
|
||||
};
|
||||
}
|
||||
case CommandPayload.CommandShipClassRemove: {
|
||||
const inner = new CommandShipClassRemove();
|
||||
item.payload(inner);
|
||||
return {
|
||||
kind: "removeShipClass",
|
||||
id,
|
||||
name: inner.name() ?? "",
|
||||
};
|
||||
}
|
||||
default:
|
||||
console.warn(
|
||||
`fetchOrder: skipping unknown command kind (payloadType=${payloadType})`,
|
||||
|
||||
Reference in New Issue
Block a user