wip: generate rest of report
This commit is contained in:
@@ -2,7 +2,6 @@ package controller
|
||||
|
||||
import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/iliadenisov/galaxy/internal/model/game"
|
||||
"github.com/iliadenisov/galaxy/internal/model/report"
|
||||
)
|
||||
|
||||
@@ -23,22 +22,26 @@ func TransformBattle(c *Cache, b *Battle) *report.BattleReport {
|
||||
shipClass := c.ShipGroupShipClass(groupId)
|
||||
sg := c.ShipGroup(groupId)
|
||||
itemNumber := len(r.Ships)
|
||||
r.Ships[itemNumber] = report.BattleReportGroup{
|
||||
OwnerID: sg.OwnerID,
|
||||
Race: c.g.Race[c.RaceIndex(sg.OwnerID)].Name,
|
||||
InBattle: inBattle,
|
||||
Number: b.initialNumbers[groupId],
|
||||
NumberLeft: sg.Number,
|
||||
ClassName: shipClass.Name,
|
||||
LoadType: sg.CargoString(),
|
||||
LoadQuantity: report.F(sg.Load.F()),
|
||||
DriveTech: report.F(sg.TechLevel(game.TechDrive).F()),
|
||||
ClassArmament: shipClass.Armament,
|
||||
WeaponsTech: report.F(sg.TechLevel(game.TechWeapons).F()),
|
||||
ShieldsTech: report.F(sg.TechLevel(game.TechShields).F()),
|
||||
CargoTech: report.F(sg.TechLevel(game.TechCargo).F()),
|
||||
ClassMass: report.F(shipClass.EmptyMass()),
|
||||
bg := &report.BattleReportGroup{
|
||||
// OwnerID: sg.OwnerID,
|
||||
// ClassArmament: shipClass.Armament,
|
||||
// ClassMass: report.F(shipClass.EmptyMass()),
|
||||
Race: c.g.Race[c.RaceIndex(sg.OwnerID)].Name,
|
||||
InBattle: inBattle,
|
||||
Number: b.initialNumbers[groupId],
|
||||
NumberLeft: sg.Number,
|
||||
ClassName: shipClass.Name,
|
||||
LoadType: sg.CargoString(),
|
||||
LoadQuantity: report.F(sg.Load.F()),
|
||||
// DriveTech: report.F(sg.TechLevel(game.TechDrive).F()),
|
||||
// WeaponsTech: report.F(sg.TechLevel(game.TechWeapons).F()),
|
||||
// ShieldsTech: report.F(sg.TechLevel(game.TechShields).F()),
|
||||
// CargoTech: report.F(sg.TechLevel(game.TechCargo).F()),
|
||||
}
|
||||
for t, v := range sg.Tech {
|
||||
bg.Tech[t.String()] = report.F(v)
|
||||
}
|
||||
r.Ships[itemNumber] = *bg
|
||||
cacheShipClass[shipClass.ID] = itemNumber
|
||||
return itemNumber
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user