chore: re-package

This commit is contained in:
IliaDenisov
2026-03-10 15:46:18 +02:00
parent bb2bb899de
commit dabe1f091a
99 changed files with 151 additions and 98 deletions
+43
View File
@@ -0,0 +1,43 @@
package report
import (
"encoding/json"
"github.com/google/uuid"
)
type BattleReport struct {
ID uuid.UUID `json:"id"`
Planet uint `json:"planet"`
PlanetName string `json:"planetName"`
Races map[int]uuid.UUID `json:"races"`
Ships map[int]BattleReportGroup `json:"ships"`
Protocol []BattleActionReport `json:"protocol"`
}
type BattleReportGroup struct {
InBattle bool `json:"inBattle"`
Number uint `json:"num"`
NumberLeft uint `json:"numLeft"`
LoadQuantity Float `json:"loadQuantity"`
Tech map[string]Float `json:"tech"`
Race string `json:"race"`
ClassName string `json:"className"`
LoadType string `json:"loadType"`
}
type BattleActionReport struct {
Attacker int `json:"a"`
AttackerShipClass int `json:"sa"`
Defender int `json:"d"`
DefenderShipClass int `json:"sd"`
Destroyed bool `json:"x"`
}
func (b BattleReport) MarshalBinary() (data []byte, err error) {
return json.Marshal(&b)
}
func (b *BattleReport) UnmarshalBinary(data []byte) error {
return json.Unmarshal(data, b)
}