ui/phase-27: battle viewer (radial scene, playback, map markers)
Engine wire change: Report.battle switched from []uuid.UUID to
[]BattleSummary{id, planet, shots} so the map can place battle
markers without N extra fetches. FBS schema + generated Go/TS
regenerated; transcoder + report controller updated; openapi
adds the BattleSummary schema with a freeze test.
Backend gateway forwards engine GET /api/v1/battle/:turn/:uuid as
/api/v1/user/games/{game_id}/battles/{turn}/{battle_id} (handler
plus engineclient.FetchBattle, contract test stub, openapi spec).
UI:
- BattleViewer (lib/battle-player/) is a logically isolated SVG
radial scene that consumes a BattleReport prop. Planet at the
centre, races on the outer ring at equal angular spacing, race
clusters by (race, className) with <class>:<numLeft> labels;
observer groups (inBattle: false) are not drawn; eliminated
races drop out and survivors re-distribute on the next frame.
- Shot line per frame: red on destroyed, green otherwise; erased
on the next frame. Playback controls: play/pause + step ± +
rewind + 1x/2x/4x speed (400/200/100 ms per frame).
- Page wrapper (lib/active-view/battle.svelte) loads BattleReport
via api/battle-fetch.ts; synthetic-gameId prefix routes to a
fixture loader, otherwise REST through the gateway. Always-
visible <ol> text protocol satisfies the accessibility ask.
- section-battles.svelte links every battle UUID into the viewer.
- map/battle-markers.ts: yellow X cross of 2 LinePrim through the
corners of the planet's circumscribed square (stroke width
clamps from 1 px at 1 shot to 5 px at 100+ shots); bombing
marker is a stroke-only ring (yellow when damaged, red when
wiped). Wired into state-binding.ts; click handler dispatches
battle clicks to the viewer and bombing clicks to the matching
Reports row.
- i18n keys for the viewer in en + ru.
Docs: ui/docs/battle-viewer-ux.md, FUNCTIONAL.md §6.5 + ru
mirror, ui/PLAN.md Phase 27 decisions + deferred TODOs (push
event, richer class visuals, animated re-distribution).
Tests: Vitest unit (radial layout + timeline frame builder +
marker stroke formula + marker primitives), Playwright e2e for
the viewer (Reports link → viewer, playback step, not-found),
backend engineclient FetchBattle (200 / 404 / bad input), engine
openapi freezes (BattleReport, BattleReportGroup,
BattleActionReport, BattleSummary, Report.battle items).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { ApplicationSummary, ApplicationSummaryT } from './application-summary.js';
|
||||
import { ApplicationSummary, ApplicationSummaryT } from '../lobby/application-summary.js';
|
||||
|
||||
|
||||
export class ApplicationSubmitResponse implements flatbuffers.IUnpackableObject<ApplicationSubmitResponseT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { ErrorBody, ErrorBodyT } from './error-body.js';
|
||||
import { ErrorBody, ErrorBodyT } from '../lobby/error-body.js';
|
||||
|
||||
|
||||
export class ErrorResponse implements flatbuffers.IUnpackableObject<ErrorResponseT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { GameSummary, GameSummaryT } from './game-summary.js';
|
||||
import { GameSummary, GameSummaryT } from '../lobby/game-summary.js';
|
||||
|
||||
|
||||
export class GameCreateResponse implements flatbuffers.IUnpackableObject<GameCreateResponseT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { InviteSummary, InviteSummaryT } from './invite-summary.js';
|
||||
import { InviteSummary, InviteSummaryT } from '../lobby/invite-summary.js';
|
||||
|
||||
|
||||
export class InviteDeclineResponse implements flatbuffers.IUnpackableObject<InviteDeclineResponseT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { InviteSummary, InviteSummaryT } from './invite-summary.js';
|
||||
import { InviteSummary, InviteSummaryT } from '../lobby/invite-summary.js';
|
||||
|
||||
|
||||
export class InviteRedeemResponse implements flatbuffers.IUnpackableObject<InviteRedeemResponseT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { ApplicationSummary, ApplicationSummaryT } from './application-summary.js';
|
||||
import { ApplicationSummary, ApplicationSummaryT } from '../lobby/application-summary.js';
|
||||
|
||||
|
||||
export class MyApplicationsListResponse implements flatbuffers.IUnpackableObject<MyApplicationsListResponseT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { GameSummary, GameSummaryT } from './game-summary.js';
|
||||
import { GameSummary, GameSummaryT } from '../lobby/game-summary.js';
|
||||
|
||||
|
||||
export class MyGamesListResponse implements flatbuffers.IUnpackableObject<MyGamesListResponseT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { InviteSummary, InviteSummaryT } from './invite-summary.js';
|
||||
import { InviteSummary, InviteSummaryT } from '../lobby/invite-summary.js';
|
||||
|
||||
|
||||
export class MyInvitesListResponse implements flatbuffers.IUnpackableObject<MyInvitesListResponseT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { GameSummary, GameSummaryT } from './game-summary.js';
|
||||
import { GameSummary, GameSummaryT } from '../lobby/game-summary.js';
|
||||
|
||||
|
||||
export class PublicGamesListResponse implements flatbuffers.IUnpackableObject<PublicGamesListResponseT> {
|
||||
|
||||
@@ -4,30 +4,30 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { CommandFleetMerge, CommandFleetMergeT } from './command-fleet-merge.js';
|
||||
import { CommandFleetSend, CommandFleetSendT } from './command-fleet-send.js';
|
||||
import { CommandPayload, unionToCommandPayload, unionListToCommandPayload } from './command-payload.js';
|
||||
import { CommandPlanetProduce, CommandPlanetProduceT } from './command-planet-produce.js';
|
||||
import { CommandPlanetRename, CommandPlanetRenameT } from './command-planet-rename.js';
|
||||
import { CommandPlanetRouteRemove, CommandPlanetRouteRemoveT } from './command-planet-route-remove.js';
|
||||
import { CommandPlanetRouteSet, CommandPlanetRouteSetT } from './command-planet-route-set.js';
|
||||
import { CommandRaceQuit, CommandRaceQuitT } from './command-race-quit.js';
|
||||
import { CommandRaceRelation, CommandRaceRelationT } from './command-race-relation.js';
|
||||
import { CommandRaceVote, CommandRaceVoteT } from './command-race-vote.js';
|
||||
import { CommandScienceCreate, CommandScienceCreateT } from './command-science-create.js';
|
||||
import { CommandScienceRemove, CommandScienceRemoveT } from './command-science-remove.js';
|
||||
import { CommandShipClassCreate, CommandShipClassCreateT } from './command-ship-class-create.js';
|
||||
import { CommandShipClassMerge, CommandShipClassMergeT } from './command-ship-class-merge.js';
|
||||
import { CommandShipClassRemove, CommandShipClassRemoveT } from './command-ship-class-remove.js';
|
||||
import { CommandShipGroupBreak, CommandShipGroupBreakT } from './command-ship-group-break.js';
|
||||
import { CommandShipGroupDismantle, CommandShipGroupDismantleT } from './command-ship-group-dismantle.js';
|
||||
import { CommandShipGroupJoinFleet, CommandShipGroupJoinFleetT } from './command-ship-group-join-fleet.js';
|
||||
import { CommandShipGroupLoad, CommandShipGroupLoadT } from './command-ship-group-load.js';
|
||||
import { CommandShipGroupMerge, CommandShipGroupMergeT } from './command-ship-group-merge.js';
|
||||
import { CommandShipGroupSend, CommandShipGroupSendT } from './command-ship-group-send.js';
|
||||
import { CommandShipGroupTransfer, CommandShipGroupTransferT } from './command-ship-group-transfer.js';
|
||||
import { CommandShipGroupUnload, CommandShipGroupUnloadT } from './command-ship-group-unload.js';
|
||||
import { CommandShipGroupUpgrade, CommandShipGroupUpgradeT } from './command-ship-group-upgrade.js';
|
||||
import { CommandFleetMerge, CommandFleetMergeT } from '../order/command-fleet-merge.js';
|
||||
import { CommandFleetSend, CommandFleetSendT } from '../order/command-fleet-send.js';
|
||||
import { CommandPayload, unionToCommandPayload, unionListToCommandPayload } from '../order/command-payload.js';
|
||||
import { CommandPlanetProduce, CommandPlanetProduceT } from '../order/command-planet-produce.js';
|
||||
import { CommandPlanetRename, CommandPlanetRenameT } from '../order/command-planet-rename.js';
|
||||
import { CommandPlanetRouteRemove, CommandPlanetRouteRemoveT } from '../order/command-planet-route-remove.js';
|
||||
import { CommandPlanetRouteSet, CommandPlanetRouteSetT } from '../order/command-planet-route-set.js';
|
||||
import { CommandRaceQuit, CommandRaceQuitT } from '../order/command-race-quit.js';
|
||||
import { CommandRaceRelation, CommandRaceRelationT } from '../order/command-race-relation.js';
|
||||
import { CommandRaceVote, CommandRaceVoteT } from '../order/command-race-vote.js';
|
||||
import { CommandScienceCreate, CommandScienceCreateT } from '../order/command-science-create.js';
|
||||
import { CommandScienceRemove, CommandScienceRemoveT } from '../order/command-science-remove.js';
|
||||
import { CommandShipClassCreate, CommandShipClassCreateT } from '../order/command-ship-class-create.js';
|
||||
import { CommandShipClassMerge, CommandShipClassMergeT } from '../order/command-ship-class-merge.js';
|
||||
import { CommandShipClassRemove, CommandShipClassRemoveT } from '../order/command-ship-class-remove.js';
|
||||
import { CommandShipGroupBreak, CommandShipGroupBreakT } from '../order/command-ship-group-break.js';
|
||||
import { CommandShipGroupDismantle, CommandShipGroupDismantleT } from '../order/command-ship-group-dismantle.js';
|
||||
import { CommandShipGroupJoinFleet, CommandShipGroupJoinFleetT } from '../order/command-ship-group-join-fleet.js';
|
||||
import { CommandShipGroupLoad, CommandShipGroupLoadT } from '../order/command-ship-group-load.js';
|
||||
import { CommandShipGroupMerge, CommandShipGroupMergeT } from '../order/command-ship-group-merge.js';
|
||||
import { CommandShipGroupSend, CommandShipGroupSendT } from '../order/command-ship-group-send.js';
|
||||
import { CommandShipGroupTransfer, CommandShipGroupTransferT } from '../order/command-ship-group-transfer.js';
|
||||
import { CommandShipGroupUnload, CommandShipGroupUnloadT } from '../order/command-ship-group-unload.js';
|
||||
import { CommandShipGroupUpgrade, CommandShipGroupUpgradeT } from '../order/command-ship-group-upgrade.js';
|
||||
|
||||
|
||||
export class CommandItem implements flatbuffers.IUnpackableObject<CommandItemT> {
|
||||
|
||||
@@ -2,29 +2,29 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import { CommandFleetMerge, CommandFleetMergeT } from './command-fleet-merge.js';
|
||||
import { CommandFleetSend, CommandFleetSendT } from './command-fleet-send.js';
|
||||
import { CommandPlanetProduce, CommandPlanetProduceT } from './command-planet-produce.js';
|
||||
import { CommandPlanetRename, CommandPlanetRenameT } from './command-planet-rename.js';
|
||||
import { CommandPlanetRouteRemove, CommandPlanetRouteRemoveT } from './command-planet-route-remove.js';
|
||||
import { CommandPlanetRouteSet, CommandPlanetRouteSetT } from './command-planet-route-set.js';
|
||||
import { CommandRaceQuit, CommandRaceQuitT } from './command-race-quit.js';
|
||||
import { CommandRaceRelation, CommandRaceRelationT } from './command-race-relation.js';
|
||||
import { CommandRaceVote, CommandRaceVoteT } from './command-race-vote.js';
|
||||
import { CommandScienceCreate, CommandScienceCreateT } from './command-science-create.js';
|
||||
import { CommandScienceRemove, CommandScienceRemoveT } from './command-science-remove.js';
|
||||
import { CommandShipClassCreate, CommandShipClassCreateT } from './command-ship-class-create.js';
|
||||
import { CommandShipClassMerge, CommandShipClassMergeT } from './command-ship-class-merge.js';
|
||||
import { CommandShipClassRemove, CommandShipClassRemoveT } from './command-ship-class-remove.js';
|
||||
import { CommandShipGroupBreak, CommandShipGroupBreakT } from './command-ship-group-break.js';
|
||||
import { CommandShipGroupDismantle, CommandShipGroupDismantleT } from './command-ship-group-dismantle.js';
|
||||
import { CommandShipGroupJoinFleet, CommandShipGroupJoinFleetT } from './command-ship-group-join-fleet.js';
|
||||
import { CommandShipGroupLoad, CommandShipGroupLoadT } from './command-ship-group-load.js';
|
||||
import { CommandShipGroupMerge, CommandShipGroupMergeT } from './command-ship-group-merge.js';
|
||||
import { CommandShipGroupSend, CommandShipGroupSendT } from './command-ship-group-send.js';
|
||||
import { CommandShipGroupTransfer, CommandShipGroupTransferT } from './command-ship-group-transfer.js';
|
||||
import { CommandShipGroupUnload, CommandShipGroupUnloadT } from './command-ship-group-unload.js';
|
||||
import { CommandShipGroupUpgrade, CommandShipGroupUpgradeT } from './command-ship-group-upgrade.js';
|
||||
import { CommandFleetMerge, CommandFleetMergeT } from '../order/command-fleet-merge.js';
|
||||
import { CommandFleetSend, CommandFleetSendT } from '../order/command-fleet-send.js';
|
||||
import { CommandPlanetProduce, CommandPlanetProduceT } from '../order/command-planet-produce.js';
|
||||
import { CommandPlanetRename, CommandPlanetRenameT } from '../order/command-planet-rename.js';
|
||||
import { CommandPlanetRouteRemove, CommandPlanetRouteRemoveT } from '../order/command-planet-route-remove.js';
|
||||
import { CommandPlanetRouteSet, CommandPlanetRouteSetT } from '../order/command-planet-route-set.js';
|
||||
import { CommandRaceQuit, CommandRaceQuitT } from '../order/command-race-quit.js';
|
||||
import { CommandRaceRelation, CommandRaceRelationT } from '../order/command-race-relation.js';
|
||||
import { CommandRaceVote, CommandRaceVoteT } from '../order/command-race-vote.js';
|
||||
import { CommandScienceCreate, CommandScienceCreateT } from '../order/command-science-create.js';
|
||||
import { CommandScienceRemove, CommandScienceRemoveT } from '../order/command-science-remove.js';
|
||||
import { CommandShipClassCreate, CommandShipClassCreateT } from '../order/command-ship-class-create.js';
|
||||
import { CommandShipClassMerge, CommandShipClassMergeT } from '../order/command-ship-class-merge.js';
|
||||
import { CommandShipClassRemove, CommandShipClassRemoveT } from '../order/command-ship-class-remove.js';
|
||||
import { CommandShipGroupBreak, CommandShipGroupBreakT } from '../order/command-ship-group-break.js';
|
||||
import { CommandShipGroupDismantle, CommandShipGroupDismantleT } from '../order/command-ship-group-dismantle.js';
|
||||
import { CommandShipGroupJoinFleet, CommandShipGroupJoinFleetT } from '../order/command-ship-group-join-fleet.js';
|
||||
import { CommandShipGroupLoad, CommandShipGroupLoadT } from '../order/command-ship-group-load.js';
|
||||
import { CommandShipGroupMerge, CommandShipGroupMergeT } from '../order/command-ship-group-merge.js';
|
||||
import { CommandShipGroupSend, CommandShipGroupSendT } from '../order/command-ship-group-send.js';
|
||||
import { CommandShipGroupTransfer, CommandShipGroupTransferT } from '../order/command-ship-group-transfer.js';
|
||||
import { CommandShipGroupUnload, CommandShipGroupUnloadT } from '../order/command-ship-group-unload.js';
|
||||
import { CommandShipGroupUpgrade, CommandShipGroupUpgradeT } from '../order/command-ship-group-upgrade.js';
|
||||
|
||||
|
||||
export enum CommandPayload {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { PlanetProduction } from './planet-production.js';
|
||||
import { PlanetProduction } from '../order/planet-production.js';
|
||||
|
||||
|
||||
export class CommandPlanetProduce implements flatbuffers.IUnpackableObject<CommandPlanetProduceT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { PlanetRouteLoadType } from './planet-route-load-type.js';
|
||||
import { PlanetRouteLoadType } from '../order/planet-route-load-type.js';
|
||||
|
||||
|
||||
export class CommandPlanetRouteRemove implements flatbuffers.IUnpackableObject<CommandPlanetRouteRemoveT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { PlanetRouteLoadType } from './planet-route-load-type.js';
|
||||
import { PlanetRouteLoadType } from '../order/planet-route-load-type.js';
|
||||
|
||||
|
||||
export class CommandPlanetRouteSet implements flatbuffers.IUnpackableObject<CommandPlanetRouteSetT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { Relation } from './relation.js';
|
||||
import { Relation } from '../order/relation.js';
|
||||
|
||||
|
||||
export class CommandRaceRelation implements flatbuffers.IUnpackableObject<CommandRaceRelationT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { ShipGroupCargo } from './ship-group-cargo.js';
|
||||
import { ShipGroupCargo } from '../order/ship-group-cargo.js';
|
||||
|
||||
|
||||
export class CommandShipGroupLoad implements flatbuffers.IUnpackableObject<CommandShipGroupLoadT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { ShipGroupUpgradeTech } from './ship-group-upgrade-tech.js';
|
||||
import { ShipGroupUpgradeTech } from '../order/ship-group-upgrade-tech.js';
|
||||
|
||||
|
||||
export class CommandShipGroupUpgrade implements flatbuffers.IUnpackableObject<CommandShipGroupUpgradeT> {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { UUID, UUIDT } from '../common/uuid.js';
|
||||
import { CommandItem, CommandItemT } from './command-item.js';
|
||||
import { CommandItem, CommandItemT } from '../order/command-item.js';
|
||||
|
||||
|
||||
export class UserGamesCommand implements flatbuffers.IUnpackableObject<UserGamesCommandT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { UserGamesOrder, UserGamesOrderT } from './user-games-order.js';
|
||||
import { UserGamesOrder, UserGamesOrderT } from '../order/user-games-order.js';
|
||||
|
||||
|
||||
export class UserGamesOrderGetResponse implements flatbuffers.IUnpackableObject<UserGamesOrderGetResponseT> {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { UUID, UUIDT } from '../common/uuid.js';
|
||||
import { CommandItem, CommandItemT } from './command-item.js';
|
||||
import { CommandItem, CommandItemT } from '../order/command-item.js';
|
||||
|
||||
|
||||
export class UserGamesOrderResponse implements flatbuffers.IUnpackableObject<UserGamesOrderResponseT> {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { UUID, UUIDT } from '../common/uuid.js';
|
||||
import { CommandItem, CommandItemT } from './command-item.js';
|
||||
import { CommandItem, CommandItemT } from '../order/command-item.js';
|
||||
|
||||
|
||||
export class UserGamesOrder implements flatbuffers.IUnpackableObject<UserGamesOrderT> {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
export { BattleSummary, BattleSummaryT } from './report/battle-summary.js';
|
||||
export { Bombing, BombingT } from './report/bombing.js';
|
||||
export { GameReportRequest, GameReportRequestT } from './report/game-report-request.js';
|
||||
export { IncomingGroup, IncomingGroupT } from './report/incoming-group.js';
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
// automatically generated by the FlatBuffers compiler, do not modify
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { UUID, UUIDT } from '../common/uuid.js';
|
||||
|
||||
|
||||
export class BattleSummary implements flatbuffers.IUnpackableObject<BattleSummaryT> {
|
||||
bb: flatbuffers.ByteBuffer|null = null;
|
||||
bb_pos = 0;
|
||||
__init(i:number, bb:flatbuffers.ByteBuffer):BattleSummary {
|
||||
this.bb_pos = i;
|
||||
this.bb = bb;
|
||||
return this;
|
||||
}
|
||||
|
||||
static getRootAsBattleSummary(bb:flatbuffers.ByteBuffer, obj?:BattleSummary):BattleSummary {
|
||||
return (obj || new BattleSummary()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
static getSizePrefixedRootAsBattleSummary(bb:flatbuffers.ByteBuffer, obj?:BattleSummary):BattleSummary {
|
||||
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
||||
return (obj || new BattleSummary()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
||||
}
|
||||
|
||||
id(obj?:UUID):UUID|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 4);
|
||||
return offset ? (obj || new UUID()).__init(this.bb_pos + offset, this.bb!) : null;
|
||||
}
|
||||
|
||||
planet():bigint {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 6);
|
||||
return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
|
||||
}
|
||||
|
||||
shots():bigint {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 8);
|
||||
return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
|
||||
}
|
||||
|
||||
static startBattleSummary(builder:flatbuffers.Builder) {
|
||||
builder.startObject(3);
|
||||
}
|
||||
|
||||
static addId(builder:flatbuffers.Builder, idOffset:flatbuffers.Offset) {
|
||||
builder.addFieldStruct(0, idOffset, 0);
|
||||
}
|
||||
|
||||
static addPlanet(builder:flatbuffers.Builder, planet:bigint) {
|
||||
builder.addFieldInt64(1, planet, BigInt('0'));
|
||||
}
|
||||
|
||||
static addShots(builder:flatbuffers.Builder, shots:bigint) {
|
||||
builder.addFieldInt64(2, shots, BigInt('0'));
|
||||
}
|
||||
|
||||
static endBattleSummary(builder:flatbuffers.Builder):flatbuffers.Offset {
|
||||
const offset = builder.endObject();
|
||||
builder.requiredField(offset, 4) // id
|
||||
return offset;
|
||||
}
|
||||
|
||||
static createBattleSummary(builder:flatbuffers.Builder, idOffset:flatbuffers.Offset, planet:bigint, shots:bigint):flatbuffers.Offset {
|
||||
BattleSummary.startBattleSummary(builder);
|
||||
BattleSummary.addId(builder, idOffset);
|
||||
BattleSummary.addPlanet(builder, planet);
|
||||
BattleSummary.addShots(builder, shots);
|
||||
return BattleSummary.endBattleSummary(builder);
|
||||
}
|
||||
|
||||
unpack(): BattleSummaryT {
|
||||
return new BattleSummaryT(
|
||||
(this.id() !== null ? this.id()!.unpack() : null),
|
||||
this.planet(),
|
||||
this.shots()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
unpackTo(_o: BattleSummaryT): void {
|
||||
_o.id = (this.id() !== null ? this.id()!.unpack() : null);
|
||||
_o.planet = this.planet();
|
||||
_o.shots = this.shots();
|
||||
}
|
||||
}
|
||||
|
||||
export class BattleSummaryT implements flatbuffers.IGeneratedObject {
|
||||
constructor(
|
||||
public id: UUIDT|null = null,
|
||||
public planet: bigint = BigInt('0'),
|
||||
public shots: bigint = BigInt('0')
|
||||
){}
|
||||
|
||||
|
||||
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
return BattleSummary.createBattleSummary(builder,
|
||||
(this.id !== null ? this.id!.pack(builder) : 0),
|
||||
this.planet,
|
||||
this.shots
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { UUID, UUIDT } from '../common/uuid.js';
|
||||
import { TechEntry, TechEntryT } from './tech-entry.js';
|
||||
import { TechEntry, TechEntryT } from '../report/tech-entry.js';
|
||||
|
||||
|
||||
export class LocalGroup implements flatbuffers.IUnpackableObject<LocalGroupT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { TechEntry, TechEntryT } from './tech-entry.js';
|
||||
import { TechEntry, TechEntryT } from '../report/tech-entry.js';
|
||||
|
||||
|
||||
export class OtherGroup implements flatbuffers.IUnpackableObject<OtherGroupT> {
|
||||
|
||||
@@ -4,24 +4,24 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { UUID, UUIDT } from '../common/uuid.js';
|
||||
import { Bombing, BombingT } from './bombing.js';
|
||||
import { IncomingGroup, IncomingGroupT } from './incoming-group.js';
|
||||
import { LocalFleet, LocalFleetT } from './local-fleet.js';
|
||||
import { LocalGroup, LocalGroupT } from './local-group.js';
|
||||
import { LocalPlanet, LocalPlanetT } from './local-planet.js';
|
||||
import { OtherGroup, OtherGroupT } from './other-group.js';
|
||||
import { OtherPlanet, OtherPlanetT } from './other-planet.js';
|
||||
import { OtherScience, OtherScienceT } from './other-science.js';
|
||||
import { OthersShipClass, OthersShipClassT } from './others-ship-class.js';
|
||||
import { Player, PlayerT } from './player.js';
|
||||
import { Route, RouteT } from './route.js';
|
||||
import { Science, ScienceT } from './science.js';
|
||||
import { ShipClass, ShipClassT } from './ship-class.js';
|
||||
import { ShipProduction, ShipProductionT } from './ship-production.js';
|
||||
import { UnidentifiedGroup, UnidentifiedGroupT } from './unidentified-group.js';
|
||||
import { UnidentifiedPlanet, UnidentifiedPlanetT } from './unidentified-planet.js';
|
||||
import { UninhabitedPlanet, UninhabitedPlanetT } from './uninhabited-planet.js';
|
||||
import { BattleSummary, BattleSummaryT } from '../report/battle-summary.js';
|
||||
import { Bombing, BombingT } from '../report/bombing.js';
|
||||
import { IncomingGroup, IncomingGroupT } from '../report/incoming-group.js';
|
||||
import { LocalFleet, LocalFleetT } from '../report/local-fleet.js';
|
||||
import { LocalGroup, LocalGroupT } from '../report/local-group.js';
|
||||
import { LocalPlanet, LocalPlanetT } from '../report/local-planet.js';
|
||||
import { OtherGroup, OtherGroupT } from '../report/other-group.js';
|
||||
import { OtherPlanet, OtherPlanetT } from '../report/other-planet.js';
|
||||
import { OtherScience, OtherScienceT } from '../report/other-science.js';
|
||||
import { OthersShipClass, OthersShipClassT } from '../report/others-ship-class.js';
|
||||
import { Player, PlayerT } from '../report/player.js';
|
||||
import { Route, RouteT } from '../report/route.js';
|
||||
import { Science, ScienceT } from '../report/science.js';
|
||||
import { ShipClass, ShipClassT } from '../report/ship-class.js';
|
||||
import { ShipProduction, ShipProductionT } from '../report/ship-production.js';
|
||||
import { UnidentifiedGroup, UnidentifiedGroupT } from '../report/unidentified-group.js';
|
||||
import { UnidentifiedPlanet, UnidentifiedPlanetT } from '../report/unidentified-planet.js';
|
||||
import { UninhabitedPlanet, UninhabitedPlanetT } from '../report/uninhabited-planet.js';
|
||||
|
||||
|
||||
export class Report implements flatbuffers.IUnpackableObject<ReportT> {
|
||||
@@ -136,9 +136,9 @@ otherShipClassLength():number {
|
||||
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
||||
}
|
||||
|
||||
battle(index: number, obj?:UUID):UUID|null {
|
||||
battle(index: number, obj?:BattleSummary):BattleSummary|null {
|
||||
const offset = this.bb!.__offset(this.bb_pos, 30);
|
||||
return offset ? (obj || new UUID()).__init(this.bb!.__vector(this.bb_pos + offset) + index * 16, this.bb!) : null;
|
||||
return offset ? (obj || new BattleSummary()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
||||
}
|
||||
|
||||
battleLength():number {
|
||||
@@ -386,8 +386,16 @@ static addBattle(builder:flatbuffers.Builder, battleOffset:flatbuffers.Offset) {
|
||||
builder.addFieldOffset(13, battleOffset, 0);
|
||||
}
|
||||
|
||||
static createBattleVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
|
||||
builder.startVector(4, data.length, 4);
|
||||
for (let i = data.length - 1; i >= 0; i--) {
|
||||
builder.addOffset(data[i]!);
|
||||
}
|
||||
return builder.endVector();
|
||||
}
|
||||
|
||||
static startBattleVector(builder:flatbuffers.Builder, numElems:number) {
|
||||
builder.startVector(16, numElems, 8);
|
||||
builder.startVector(4, numElems, 4);
|
||||
}
|
||||
|
||||
static addBombing(builder:flatbuffers.Builder, bombingOffset:flatbuffers.Offset) {
|
||||
@@ -641,7 +649,7 @@ unpack(): ReportT {
|
||||
this.bb!.createObjList<OtherScience, OtherScienceT>(this.otherScience.bind(this), this.otherScienceLength()),
|
||||
this.bb!.createObjList<ShipClass, ShipClassT>(this.localShipClass.bind(this), this.localShipClassLength()),
|
||||
this.bb!.createObjList<OthersShipClass, OthersShipClassT>(this.otherShipClass.bind(this), this.otherShipClassLength()),
|
||||
this.bb!.createObjList<UUID, UUIDT>(this.battle.bind(this), this.battleLength()),
|
||||
this.bb!.createObjList<BattleSummary, BattleSummaryT>(this.battle.bind(this), this.battleLength()),
|
||||
this.bb!.createObjList<Bombing, BombingT>(this.bombing.bind(this), this.bombingLength()),
|
||||
this.bb!.createObjList<IncomingGroup, IncomingGroupT>(this.incomingGroup.bind(this), this.incomingGroupLength()),
|
||||
this.bb!.createObjList<LocalPlanet, LocalPlanetT>(this.localPlanet.bind(this), this.localPlanetLength()),
|
||||
@@ -672,7 +680,7 @@ unpackTo(_o: ReportT): void {
|
||||
_o.otherScience = this.bb!.createObjList<OtherScience, OtherScienceT>(this.otherScience.bind(this), this.otherScienceLength());
|
||||
_o.localShipClass = this.bb!.createObjList<ShipClass, ShipClassT>(this.localShipClass.bind(this), this.localShipClassLength());
|
||||
_o.otherShipClass = this.bb!.createObjList<OthersShipClass, OthersShipClassT>(this.otherShipClass.bind(this), this.otherShipClassLength());
|
||||
_o.battle = this.bb!.createObjList<UUID, UUIDT>(this.battle.bind(this), this.battleLength());
|
||||
_o.battle = this.bb!.createObjList<BattleSummary, BattleSummaryT>(this.battle.bind(this), this.battleLength());
|
||||
_o.bombing = this.bb!.createObjList<Bombing, BombingT>(this.bombing.bind(this), this.bombingLength());
|
||||
_o.incomingGroup = this.bb!.createObjList<IncomingGroup, IncomingGroupT>(this.incomingGroup.bind(this), this.incomingGroupLength());
|
||||
_o.localPlanet = this.bb!.createObjList<LocalPlanet, LocalPlanetT>(this.localPlanet.bind(this), this.localPlanetLength());
|
||||
@@ -703,7 +711,7 @@ constructor(
|
||||
public otherScience: (OtherScienceT)[] = [],
|
||||
public localShipClass: (ShipClassT)[] = [],
|
||||
public otherShipClass: (OthersShipClassT)[] = [],
|
||||
public battle: (UUIDT)[] = [],
|
||||
public battle: (BattleSummaryT)[] = [],
|
||||
public bombing: (BombingT)[] = [],
|
||||
public incomingGroup: (IncomingGroupT)[] = [],
|
||||
public localPlanet: (LocalPlanetT)[] = [],
|
||||
@@ -727,7 +735,7 @@ pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
||||
const otherScience = Report.createOtherScienceVector(builder, builder.createObjectOffsetList(this.otherScience));
|
||||
const localShipClass = Report.createLocalShipClassVector(builder, builder.createObjectOffsetList(this.localShipClass));
|
||||
const otherShipClass = Report.createOtherShipClassVector(builder, builder.createObjectOffsetList(this.otherShipClass));
|
||||
const battle = builder.createStructOffsetList(this.battle, Report.startBattleVector);
|
||||
const battle = Report.createBattleVector(builder, builder.createObjectOffsetList(this.battle));
|
||||
const bombing = Report.createBombingVector(builder, builder.createObjectOffsetList(this.bombing));
|
||||
const incomingGroup = Report.createIncomingGroupVector(builder, builder.createObjectOffsetList(this.incomingGroup));
|
||||
const localPlanet = Report.createLocalPlanetVector(builder, builder.createObjectOffsetList(this.localPlanet));
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { RouteEntry, RouteEntryT } from './route-entry.js';
|
||||
import { RouteEntry, RouteEntryT } from '../report/route-entry.js';
|
||||
|
||||
|
||||
export class Route implements flatbuffers.IUnpackableObject<RouteT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { AccountView, AccountViewT } from './account-view.js';
|
||||
import { AccountView, AccountViewT } from '../user/account-view.js';
|
||||
|
||||
|
||||
export class AccountResponse implements flatbuffers.IUnpackableObject<AccountResponseT> {
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { ActiveLimit, ActiveLimitT } from './active-limit.js';
|
||||
import { ActiveSanction, ActiveSanctionT } from './active-sanction.js';
|
||||
import { EntitlementSnapshot, EntitlementSnapshotT } from './entitlement-snapshot.js';
|
||||
import { ActiveLimit, ActiveLimitT } from '../user/active-limit.js';
|
||||
import { ActiveSanction, ActiveSanctionT } from '../user/active-sanction.js';
|
||||
import { EntitlementSnapshot, EntitlementSnapshotT } from '../user/entitlement-snapshot.js';
|
||||
|
||||
|
||||
export class AccountView implements flatbuffers.IUnpackableObject<AccountViewT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { ActorRef, ActorRefT } from './actor-ref.js';
|
||||
import { ActorRef, ActorRefT } from '../user/actor-ref.js';
|
||||
|
||||
|
||||
export class ActiveLimit implements flatbuffers.IUnpackableObject<ActiveLimitT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { ActorRef, ActorRefT } from './actor-ref.js';
|
||||
import { ActorRef, ActorRefT } from '../user/actor-ref.js';
|
||||
|
||||
|
||||
export class ActiveSanction implements flatbuffers.IUnpackableObject<ActiveSanctionT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { ActorRef, ActorRefT } from './actor-ref.js';
|
||||
import { ActorRef, ActorRefT } from '../user/actor-ref.js';
|
||||
|
||||
|
||||
export class EntitlementSnapshot implements flatbuffers.IUnpackableObject<EntitlementSnapshotT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { ErrorBody, ErrorBodyT } from './error-body.js';
|
||||
import { ErrorBody, ErrorBodyT } from '../user/error-body.js';
|
||||
|
||||
|
||||
export class ErrorResponse implements flatbuffers.IUnpackableObject<ErrorResponseT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { DeviceSessionView, DeviceSessionViewT } from './device-session-view.js';
|
||||
import { DeviceSessionView, DeviceSessionViewT } from '../user/device-session-view.js';
|
||||
|
||||
|
||||
export class ListMySessionsResponse implements flatbuffers.IUnpackableObject<ListMySessionsResponseT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { DeviceSessionRevocationSummaryView, DeviceSessionRevocationSummaryViewT } from './device-session-revocation-summary-view.js';
|
||||
import { DeviceSessionRevocationSummaryView, DeviceSessionRevocationSummaryViewT } from '../user/device-session-revocation-summary-view.js';
|
||||
|
||||
|
||||
export class RevokeAllMySessionsResponse implements flatbuffers.IUnpackableObject<RevokeAllMySessionsResponseT> {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import * as flatbuffers from 'flatbuffers';
|
||||
|
||||
import { DeviceSessionView, DeviceSessionViewT } from './device-session-view.js';
|
||||
import { DeviceSessionView, DeviceSessionViewT } from '../user/device-session-view.js';
|
||||
|
||||
|
||||
export class RevokeMySessionResponse implements flatbuffers.IUnpackableObject<RevokeMySessionResponseT> {
|
||||
|
||||
Reference in New Issue
Block a user