This commit is contained in:
Robert Janetzko 2022-04-16 20:12:23 +00:00
parent 71cb14c0cd
commit cbc9601c33
11 changed files with 1437 additions and 268 deletions

View File

@ -7,9 +7,11 @@ import (
"go/format" "go/format"
"io/ioutil" "io/ioutil"
"os" "os"
"strings"
"text/template" "text/template"
"github.com/iancoleman/strcase" "github.com/iancoleman/strcase"
"github.com/robertjanetzko/LegendsBrowser2/backend/util"
) )
var backendTemplate = template.Must(template.New("").Parse(`// Code generated by legendsbrowser; DO NOT EDIT. var backendTemplate = template.Must(template.New("").Parse(`// Code generated by legendsbrowser; DO NOT EDIT.
@ -29,7 +31,7 @@ type {{ $obj.Name }} struct {
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- if not (not $obj.SubTypes) }} {{- if not (not $obj.SubTypes) }}
Details any Details {{ $obj.Name }}Details
{{- end }} {{- end }}
} }
@ -39,6 +41,7 @@ func (x *{{ $obj.Name }}) Id() int { return x.Id_ }
{{- if $obj.Named }} {{- if $obj.Named }}
func (x *{{ $obj.Name }}) Name() string { return x.Name_ } func (x *{{ $obj.Name }}) Name() string { return x.Name_ }
{{- end }} {{- end }}
func (x *{{ $obj.Name }}) RelatedToHf(id int) bool { return {{ $obj.Related "hfid,hf_id,_hf,hist_figure_id,Hfid,histfig_id,histfig" }} }
{{- end }} {{- end }}
// Parser // Parser
@ -214,7 +217,12 @@ func (f Field) StartAction(plus bool) string {
} }
if f.Type == "object" { if f.Type == "object" {
p := fmt.Sprintf("v, _ := parse%s(d, &t)", *f.ElementType) var p string
if !plus {
p = fmt.Sprintf("v, _ := parse%s(d, &t)", *f.ElementType)
} else {
p = fmt.Sprintf("v, _ := parse%sPlus(d, &t, &%s{})", *f.ElementType, *f.ElementType)
}
if !f.Multiple { if !f.Multiple {
return fmt.Sprintf("%s\nobj.%s = v", p, n) return fmt.Sprintf("%s\nobj.%s = v", p, n)
} else { } else {
@ -271,3 +279,17 @@ func (f Field) EndAction() string {
return "" return ""
} }
func (obj Object) Related(fields string) string {
var list []string
fs := strings.Split(fields, ",")
for n, f := range obj.Fields {
if f.Type == "int" && !f.Multiple && util.ContainsAny(n, fs...) {
list = append(list, fmt.Sprintf("x.%s == id", f.Name))
}
}
if len(list) > 0 {
return strings.Join(list, " || ")
}
return "false"
}

View File

@ -61,6 +61,9 @@ func (f Field) JsonTypeLine() string {
if f.Type == "int" { if f.Type == "int" {
t = "number" t = "number"
} }
if f.Type == "bool" {
t = "boolean"
}
if f.Type == "array" { if f.Type == "array" {
t = *f.ElementType + "[]" t = *f.ElementType + "[]"
} }

View File

@ -17,7 +17,6 @@ import (
"github.com/gorilla/mux" "github.com/gorilla/mux"
"github.com/pkg/profile" "github.com/pkg/profile"
"github.com/robertjanetzko/LegendsBrowser2/backend/model" "github.com/robertjanetzko/LegendsBrowser2/backend/model"
"github.com/robertjanetzko/LegendsBrowser2/backend/server"
"github.com/robertjanetzko/LegendsBrowser2/backend/templates" "github.com/robertjanetzko/LegendsBrowser2/backend/templates"
) )
@ -62,6 +61,21 @@ func main() {
}, },
"getHf": func(id int) *model.HistoricalFigure { return world.HistoricalFigures[id] }, "getHf": func(id int) *model.HistoricalFigure { return world.HistoricalFigures[id] },
"getEntity": func(id int) *model.Entity { return world.Entities[id] }, "getEntity": func(id int) *model.Entity { return world.Entities[id] },
"events": func(obj model.Identifiable) []*model.HistoricalEvent {
id := obj.Id()
var list []*model.HistoricalEvent
switch obj.(type) {
case *model.HistoricalFigure:
for _, e := range world.HistoricalEvents {
if e.Details.RelatedToHf(id) {
list = append(list, e)
}
}
default:
fmt.Printf("unknown type %T\n", obj)
}
return list
},
} }
t := templates.New(functions) t := templates.New(functions)
@ -100,22 +114,23 @@ func main() {
// model.ListOtherElements("poeticForm", &world.PoeticForms) // model.ListOtherElements("poeticForm", &world.PoeticForms)
// model.ListOtherElements("written", &world.WrittenContents) // model.ListOtherElements("written", &world.WrittenContents)
server.RegisterResource(router, "region", world.Regions) // server.RegisterResource(router, "region", world.Regions)
// server.RegisterResource(router, "undergroundRegion", world.UndergroundRegions) // // server.RegisterResource(router, "undergroundRegion", world.UndergroundRegions)
server.RegisterResource(router, "landmass", world.Landmasses) // server.RegisterResource(router, "landmass", world.Landmasses)
server.RegisterResource(router, "site", world.Sites) // server.RegisterResource(router, "site", world.Sites)
server.RegisterResource(router, "worldConstruction", world.WorldConstructions) // server.RegisterResource(router, "worldConstruction", world.WorldConstructions)
server.RegisterResource(router, "artifact", world.Artifacts) // server.RegisterResource(router, "artifact", world.Artifacts)
server.RegisterResource(router, "hf", world.HistoricalFigures) // server.RegisterResource(router, "hf", world.HistoricalFigures)
server.RegisterResource(router, "collection", world.HistoricalEventCollections) // server.RegisterResource(router, "collection", world.HistoricalEventCollections)
server.RegisterResource(router, "entity", world.Entities) // server.RegisterResource(router, "entity", world.Entities)
server.RegisterResource(router, "event", world.HistoricalEvents) // server.RegisterResource(router, "event", world.HistoricalEvents)
// server.RegisterResource(router, "era", world.HistoricalEras) // // server.RegisterResource(router, "era", world.HistoricalEras)
server.RegisterResource(router, "danceForm", world.DanceForms) // server.RegisterResource(router, "danceForm", world.DanceForms)
server.RegisterResource(router, "musicalForm", world.MusicalForms) // server.RegisterResource(router, "musicalForm", world.MusicalForms)
server.RegisterResource(router, "poeticForm", world.PoeticForms) // server.RegisterResource(router, "poeticForm", world.PoeticForms)
// server.RegisterResource(router, "written", world.WrittenContents) // server.RegisterResource(router, "written", world.WrittenContents)
RegisterPage(router, "/entity/{id}", t, "entity.html", func(id int) any { return world.Entities[id] })
RegisterPage(router, "/hf/{id}", t, "hf.html", func(id int) any { return world.HistoricalFigures[id] }) RegisterPage(router, "/hf/{id}", t, "hf.html", func(id int) any { return world.HistoricalFigures[id] })
} }
@ -135,6 +150,7 @@ func RegisterPage(router *mux.Router, path string, templates *templates.Template
fmt.Fprintln(w, err) fmt.Fprintln(w, err)
fmt.Println(err) fmt.Println(err)
} }
fmt.Println("render", template, id)
err = templates.Render(w, template, accessor(id)) err = templates.Render(w, template, accessor(id))
if err != nil { if err != nil {
fmt.Fprintln(w, err) fmt.Fprintln(w, err)

View File

@ -0,0 +1,17 @@
package model
func (e *Entity) Position(id int) *EntityPosition {
for _, p := range e.EntityPosition {
if p.Id_ == id {
return p
}
}
return nil
}
type HistoricalEventDetails interface {
RelatedToHf(int) bool
}
type HistoricalEventCollectionDetails interface {
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
{{template "layout.html" .}}
{{define "title"}}{{ title .Name }}{{end}}
{{define "content"}}
{{ json . }}
{{- end }}

View File

@ -0,0 +1,7 @@
<ul>
{{- range $event := events . }}
<li>
{{ $event.Id }} in of {{ $event.Year }} {{ json $event.Details }}
</li>
{{- end}}
</ul>

View File

@ -7,6 +7,23 @@
{{ .Race }} (*{{ .BirthYear }}{{ if ge .DeathYear 0 }} †{{ .DeathYear }}{{ end }}) {{ .Race }} (*{{ .BirthYear }}{{ if ge .DeathYear 0 }} †{{ .DeathYear }}{{ end }})
{{end}} {{end}}
{{- if or (ne 0 (len .EntityFormerPositionLink)) (ne 0 (len .EntityPositionLink)) }}
<h3>Positions</h3>
<ul>
{{- range $i := .EntityFormerPositionLink }}
<li>
{{ ((getEntity $i.EntityId).Position $i.PositionProfileId).Name }} of {{ template "entityLink.html" (getEntity $i.EntityId) }} ({{
$i.StartYear }} - {{ $i.EndYear }})
</li>
{{- end }}
{{- range $i := .EntityPositionLink }}
<li>
of {{ template "entityLink.html" (getEntity $i.EntityId) }}
</li>
{{- end }}
</ul>
{{- end }}
{{- if ne 0 (len .HfLink) }} {{- if ne 0 (len .HfLink) }}
<h3>Related Figures</h3> <h3>Related Figures</h3>
<ul> <ul>
@ -28,3 +45,9 @@
{{- end }} {{- end }}
</ul> </ul>
{{- end }} {{- end }}
<h3>Events</h3>
{{ template "events.html" . }}
{{ json . }}

View File

@ -2,6 +2,7 @@ package templates
import ( import (
"embed" "embed"
"fmt"
"html/template" "html/template"
"io" "io"
) )
@ -23,10 +24,10 @@ func New(funcMap template.FuncMap) *Template {
} }
func NewDebug(funcMap template.FuncMap) *Template { func NewDebug(funcMap template.FuncMap) *Template {
templates := template.Must(template.New("").Funcs(funcMap).ParseGlob("templates/*.html")) ts := template.Must(template.New("").Funcs(funcMap).ParseGlob("templates/*.html"))
return &Template{ return &Template{
funcMap: funcMap, funcMap: funcMap,
templates: templates, templates: ts,
} }
} }
@ -34,7 +35,12 @@ var DebugTemplates = true
func (t *Template) Render(w io.Writer, name string, data interface{}) error { func (t *Template) Render(w io.Writer, name string, data interface{}) error {
if DebugTemplates { if DebugTemplates {
return NewDebug(t.funcMap).templates.ExecuteTemplate(w, name, data) fmt.Println("RENDER", name)
tmpl := NewDebug(t.funcMap).templates
tmpl = template.Must(tmpl.ParseFiles("templates/" + name))
return tmpl.ExecuteTemplate(w, name, data)
} }
return t.templates.ExecuteTemplate(w, name, data) tmpl := template.Must(t.templates.Clone())
tmpl = template.Must(tmpl.ParseFS(templateFS, name))
return tmpl.ExecuteTemplate(w, name, data)
} }

View File

@ -18,125 +18,125 @@ export interface Artifact {
writing: number; writing: number;
} }
export interface Creature { export interface Creature {
allCastesAlive: bool; allCastesAlive: boolean;
artificialHiveable: bool; artificialHiveable: boolean;
biomeDesertBadland: bool; biomeDesertBadland: boolean;
biomeDesertRock: bool; biomeDesertRock: boolean;
biomeDesertSand: bool; biomeDesertSand: boolean;
biomeForestTaiga: bool; biomeForestTaiga: boolean;
biomeForestTemperateBroadleaf: bool; biomeForestTemperateBroadleaf: boolean;
biomeForestTemperateConifer: bool; biomeForestTemperateConifer: boolean;
biomeForestTropicalConifer: bool; biomeForestTropicalConifer: boolean;
biomeForestTropicalDryBroadleaf: bool; biomeForestTropicalDryBroadleaf: boolean;
biomeForestTropicalMoistBroadleaf: bool; biomeForestTropicalMoistBroadleaf: boolean;
biomeGlacier: bool; biomeGlacier: boolean;
biomeGrasslandTemperate: bool; biomeGrasslandTemperate: boolean;
biomeGrasslandTropical: bool; biomeGrasslandTropical: boolean;
biomeLakeTemperateBrackishwater: bool; biomeLakeTemperateBrackishwater: boolean;
biomeLakeTemperateFreshwater: bool; biomeLakeTemperateFreshwater: boolean;
biomeLakeTemperateSaltwater: bool; biomeLakeTemperateSaltwater: boolean;
biomeLakeTropicalBrackishwater: bool; biomeLakeTropicalBrackishwater: boolean;
biomeLakeTropicalFreshwater: bool; biomeLakeTropicalFreshwater: boolean;
biomeLakeTropicalSaltwater: bool; biomeLakeTropicalSaltwater: boolean;
biomeMarshTemperateFreshwater: bool; biomeMarshTemperateFreshwater: boolean;
biomeMarshTemperateSaltwater: bool; biomeMarshTemperateSaltwater: boolean;
biomeMarshTropicalFreshwater: bool; biomeMarshTropicalFreshwater: boolean;
biomeMarshTropicalSaltwater: bool; biomeMarshTropicalSaltwater: boolean;
biomeMountain: bool; biomeMountain: boolean;
biomeOceanArctic: bool; biomeOceanArctic: boolean;
biomeOceanTemperate: bool; biomeOceanTemperate: boolean;
biomeOceanTropical: bool; biomeOceanTropical: boolean;
biomePoolTemperateBrackishwater: bool; biomePoolTemperateBrackishwater: boolean;
biomePoolTemperateFreshwater: bool; biomePoolTemperateFreshwater: boolean;
biomePoolTemperateSaltwater: bool; biomePoolTemperateSaltwater: boolean;
biomePoolTropicalBrackishwater: bool; biomePoolTropicalBrackishwater: boolean;
biomePoolTropicalFreshwater: bool; biomePoolTropicalFreshwater: boolean;
biomePoolTropicalSaltwater: bool; biomePoolTropicalSaltwater: boolean;
biomeRiverTemperateBrackishwater: bool; biomeRiverTemperateBrackishwater: boolean;
biomeRiverTemperateFreshwater: bool; biomeRiverTemperateFreshwater: boolean;
biomeRiverTemperateSaltwater: bool; biomeRiverTemperateSaltwater: boolean;
biomeRiverTropicalBrackishwater: bool; biomeRiverTropicalBrackishwater: boolean;
biomeRiverTropicalFreshwater: bool; biomeRiverTropicalFreshwater: boolean;
biomeRiverTropicalSaltwater: bool; biomeRiverTropicalSaltwater: boolean;
biomeSavannaTemperate: bool; biomeSavannaTemperate: boolean;
biomeSavannaTropical: bool; biomeSavannaTropical: boolean;
biomeShrublandTemperate: bool; biomeShrublandTemperate: boolean;
biomeShrublandTropical: bool; biomeShrublandTropical: boolean;
biomeSubterraneanChasm: bool; biomeSubterraneanChasm: boolean;
biomeSubterraneanLava: bool; biomeSubterraneanLava: boolean;
biomeSubterraneanWater: bool; biomeSubterraneanWater: boolean;
biomeSwampMangrove: bool; biomeSwampMangrove: boolean;
biomeSwampTemperateFreshwater: bool; biomeSwampTemperateFreshwater: boolean;
biomeSwampTemperateSaltwater: bool; biomeSwampTemperateSaltwater: boolean;
biomeSwampTropicalFreshwater: bool; biomeSwampTropicalFreshwater: boolean;
biomeSwampTropicalSaltwater: bool; biomeSwampTropicalSaltwater: boolean;
biomeTundra: bool; biomeTundra: boolean;
creatureId: string; creatureId: string;
doesNotExist: bool; doesNotExist: boolean;
equipment: bool; equipment: boolean;
equipmentWagon: bool; equipmentWagon: boolean;
evil: bool; evil: boolean;
fanciful: bool; fanciful: boolean;
generated: bool; generated: boolean;
good: bool; good: boolean;
hasAnyBenign: bool; hasAnyBenign: boolean;
hasAnyCanSwim: bool; hasAnyCanSwim: boolean;
hasAnyCannotBreatheAir: bool; hasAnyCannotBreatheAir: boolean;
hasAnyCannotBreatheWater: bool; hasAnyCannotBreatheWater: boolean;
hasAnyCarnivore: bool; hasAnyCarnivore: boolean;
hasAnyCommonDomestic: bool; hasAnyCommonDomestic: boolean;
hasAnyCuriousBeast: bool; hasAnyCuriousBeast: boolean;
hasAnyDemon: bool; hasAnyDemon: boolean;
hasAnyFeatureBeast: bool; hasAnyFeatureBeast: boolean;
hasAnyFlier: bool; hasAnyFlier: boolean;
hasAnyFlyRaceGait: bool; hasAnyFlyRaceGait: boolean;
hasAnyGrasp: bool; hasAnyGrasp: boolean;
hasAnyGrazer: bool; hasAnyGrazer: boolean;
hasAnyHasBlood: bool; hasAnyHasBlood: boolean;
hasAnyImmobile: bool; hasAnyImmobile: boolean;
hasAnyIntelligentLearns: bool; hasAnyIntelligentLearns: boolean;
hasAnyIntelligentSpeaks: bool; hasAnyIntelligentSpeaks: boolean;
hasAnyLargePredator: bool; hasAnyLargePredator: boolean;
hasAnyLocalPopsControllable: bool; hasAnyLocalPopsControllable: boolean;
hasAnyLocalPopsProduceHeroes: bool; hasAnyLocalPopsProduceHeroes: boolean;
hasAnyMegabeast: bool; hasAnyMegabeast: boolean;
hasAnyMischievous: bool; hasAnyMischievous: boolean;
hasAnyNaturalAnimal: bool; hasAnyNaturalAnimal: boolean;
hasAnyNightCreature: bool; hasAnyNightCreature: boolean;
hasAnyNightCreatureBogeyman: bool; hasAnyNightCreatureBogeyman: boolean;
hasAnyNightCreatureHunter: bool; hasAnyNightCreatureHunter: boolean;
hasAnyNightCreatureNightmare: bool; hasAnyNightCreatureNightmare: boolean;
hasAnyNotFireimmune: bool; hasAnyNotFireimmune: boolean;
hasAnyNotLiving: bool; hasAnyNotLiving: boolean;
hasAnyOutsiderControllable: bool; hasAnyOutsiderControllable: boolean;
hasAnyRaceGait: bool; hasAnyRaceGait: boolean;
hasAnySemimegabeast: bool; hasAnySemimegabeast: boolean;
hasAnySlowLearner: bool; hasAnySlowLearner: boolean;
hasAnySupernatural: bool; hasAnySupernatural: boolean;
hasAnyTitan: bool; hasAnyTitan: boolean;
hasAnyUniqueDemon: bool; hasAnyUniqueDemon: boolean;
hasAnyUtterances: bool; hasAnyUtterances: boolean;
hasAnyVerminHateable: bool; hasAnyVerminHateable: boolean;
hasAnyVerminMicro: bool; hasAnyVerminMicro: boolean;
hasFemale: bool; hasFemale: boolean;
hasMale: bool; hasMale: boolean;
largeRoaming: bool; largeRoaming: boolean;
looseClusters: bool; looseClusters: boolean;
matesToBreed: bool; matesToBreed: boolean;
mundane: bool; mundane: boolean;
namePlural: string; namePlural: string;
nameSingular: string; nameSingular: string;
occursAsEntityRace: bool; occursAsEntityRace: boolean;
savage: bool; savage: boolean;
smallRace: bool; smallRace: boolean;
twoGenders: bool; twoGenders: boolean;
ubiquitous: bool; ubiquitous: boolean;
verminEater: bool; verminEater: boolean;
verminFish: bool; verminFish: boolean;
verminGrounder: bool; verminGrounder: boolean;
verminRotter: bool; verminRotter: boolean;
verminSoil: bool; verminSoil: boolean;
verminSoilColony: bool; verminSoilColony: boolean;
} }
export interface DanceForm { export interface DanceForm {
description: string; description: string;
@ -294,13 +294,13 @@ export interface HistoricalEventAgreementFormed {
agreementId: number; agreementId: number;
allyDefenseBonus: number; allyDefenseBonus: number;
coconspiratorBonus: number; coconspiratorBonus: number;
delegated: bool; delegated: boolean;
failedJudgmentTest: bool; failedJudgmentTest: boolean;
method: string; method: string;
relevantEntityId: number; relevantEntityId: number;
relevantIdForMethod: number; relevantIdForMethod: number;
relevantPositionProfileId: number; relevantPositionProfileId: number;
successful: bool; successful: boolean;
topFacet: string; topFacet: string;
topFacetModifier: number; topFacetModifier: number;
topFacetRating: number; topFacetRating: number;
@ -324,7 +324,7 @@ export interface HistoricalEventArtifactCopied {
destEntityId: number; destEntityId: number;
destSiteId: number; destSiteId: number;
destStructureId: number; destStructureId: number;
fromOriginal: bool; fromOriginal: boolean;
sourceEntityId: number; sourceEntityId: number;
sourceSiteId: number; sourceSiteId: number;
sourceStructureId: number; sourceStructureId: number;
@ -335,7 +335,7 @@ export interface HistoricalEventArtifactCreated {
creatorHfid: number; creatorHfid: number;
creatorUnitId: number; creatorUnitId: number;
histFigureId: number; histFigureId: number;
nameOnly: bool; nameOnly: boolean;
reason: string; reason: string;
sanctifyHf: number; sanctifyHf: number;
site: number; site: number;
@ -444,10 +444,10 @@ export interface HistoricalEventBuildingProfileAcquired {
acquirerEnid: number; acquirerEnid: number;
acquirerHfid: number; acquirerHfid: number;
buildingProfileId: number; buildingProfileId: number;
inherited: bool; inherited: boolean;
lastOwnerHfid: number; lastOwnerHfid: number;
purchasedUnowned: bool; purchasedUnowned: boolean;
rebuiltRuined: bool; rebuiltRuined: boolean;
siteId: number; siteId: number;
} }
export interface HistoricalEventCeremony { export interface HistoricalEventCeremony {
@ -522,26 +522,26 @@ export interface HistoricalEventCollectionBattle {
aSupportMercHfid: number[]; aSupportMercHfid: number[];
attackingHfid: number[]; attackingHfid: number[];
attackingMercEnid: number; attackingMercEnid: number;
attackingSquadAnimated: bool[]; attackingSquadAnimated: boolean[];
attackingSquadDeaths: number[]; attackingSquadDeaths: number[];
attackingSquadEntityPop: number[]; attackingSquadEntityPop: number[];
attackingSquadNumber: number[]; attackingSquadNumber: number[];
attackingSquadRace: string[]; attackingSquadRace: string[];
attackingSquadSite: number[]; attackingSquadSite: number[];
companyMerc: bool[]; companyMerc: boolean[];
coords: string; coords: string;
dSupportMercEnid: number; dSupportMercEnid: number;
dSupportMercHfid: number[]; dSupportMercHfid: number[];
defendingHfid: number[]; defendingHfid: number[];
defendingMercEnid: number; defendingMercEnid: number;
defendingSquadAnimated: bool[]; defendingSquadAnimated: boolean[];
defendingSquadDeaths: number[]; defendingSquadDeaths: number[];
defendingSquadEntityPop: number[]; defendingSquadEntityPop: number[];
defendingSquadNumber: number[]; defendingSquadNumber: number[];
defendingSquadRace: string[]; defendingSquadRace: string[];
defendingSquadSite: number[]; defendingSquadSite: number[];
featureLayerId: number; featureLayerId: number;
individualMerc: bool[]; individualMerc: boolean[];
name: string; name: string;
noncomHfid: number[]; noncomHfid: number[];
outcome: string; outcome: string;
@ -655,7 +655,7 @@ export interface HistoricalEventCreatedStructure {
civ: number; civ: number;
civId: number; civId: number;
rebuild: string; rebuild: string;
rebuilt: bool; rebuilt: boolean;
site: number; site: number;
siteCiv: number; siteCiv: number;
siteCivId: number; siteCivId: number;
@ -726,7 +726,7 @@ export interface HistoricalEventEntityIncorporated {
joinedEntityId: number; joinedEntityId: number;
joinerEntityId: number; joinerEntityId: number;
leaderHfid: number; leaderHfid: number;
partialIncorporation: bool; partialIncorporation: boolean;
siteId: number; siteId: number;
} }
export interface HistoricalEventEntityLaw { export interface HistoricalEventEntityLaw {
@ -789,7 +789,7 @@ export interface HistoricalEventFailedIntrigueCorruption {
coconspiratorBonus: number; coconspiratorBonus: number;
corruptorHfid: number; corruptorHfid: number;
corruptorIdentity: number; corruptorIdentity: number;
failedJudgmentTest: bool; failedJudgmentTest: boolean;
featureLayerId: number; featureLayerId: number;
lureHfid: number; lureHfid: number;
method: string; method: string;
@ -856,27 +856,27 @@ export interface HistoricalEventHfConvicted {
coconspiratorHfid: number; coconspiratorHfid: number;
confessedAfterApbArrestEnid: number; confessedAfterApbArrestEnid: number;
contactHfid: number; contactHfid: number;
convictIsContact: bool; convictIsContact: boolean;
convictedHfid: number; convictedHfid: number;
convicterEnid: number; convicterEnid: number;
corruptConvicterHfid: number; corruptConvicterHfid: number;
crime: string; crime: string;
deathPenalty: bool; deathPenalty: boolean;
didNotRevealAllInInterrogation: bool; didNotRevealAllInInterrogation: boolean;
exiled: bool; exiled: boolean;
fooledHfid: number; fooledHfid: number;
framerHfid: number; framerHfid: number;
heldFirmInInterrogation: bool; heldFirmInInterrogation: boolean;
implicatedHfid: number[]; implicatedHfid: number[];
interrogatorHfid: number; interrogatorHfid: number;
plotterHfid: number; plotterHfid: number;
prisonMonths: number; prisonMonths: number;
surveiledCoconspirator: bool; surveiledCoconspirator: boolean;
surveiledContact: bool; surveiledContact: boolean;
surveiledConvicted: bool; surveiledConvicted: boolean;
surveiledTarget: bool; surveiledTarget: boolean;
targetHfid: number; targetHfid: number;
wrongfulConviction: bool; wrongfulConviction: boolean;
} }
export interface HistoricalEventHfDestroyedSite { export interface HistoricalEventHfDestroyedSite {
attackerHfid: number; attackerHfid: number;
@ -891,7 +891,9 @@ export interface HistoricalEventHfDied {
featureLayerId: number; featureLayerId: number;
hfid: number; hfid: number;
item: number; item: number;
itemSubtype: string;
itemType: string; itemType: string;
mat: string;
site: number; site: number;
siteId: number; siteId: number;
slayerCaste: string; slayerCaste: string;
@ -943,10 +945,10 @@ export interface HistoricalEventHfGainsSecretGoal {
} }
export interface HistoricalEventHfInterrogated { export interface HistoricalEventHfInterrogated {
arrestingEnid: number; arrestingEnid: number;
heldFirmInInterrogation: bool; heldFirmInInterrogation: boolean;
interrogatorHfid: number; interrogatorHfid: number;
targetHfid: number; targetHfid: number;
wantedAndRecognized: bool; wantedAndRecognized: boolean;
} }
export interface HistoricalEventHfLearnsSecret { export interface HistoricalEventHfLearnsSecret {
artifact: number; artifact: number;
@ -1027,7 +1029,7 @@ export interface HistoricalEventHfReunion {
} }
export interface HistoricalEventHfRevived { export interface HistoricalEventHfRevived {
actorHfid: number; actorHfid: number;
disturbance: bool; disturbance: boolean;
featureLayerId: number; featureLayerId: number;
hfid: number; hfid: number;
siteId: number; siteId: number;
@ -1045,7 +1047,7 @@ export interface HistoricalEventHfTravel {
coords: string; coords: string;
featureLayerId: number; featureLayerId: number;
groupHfid: number[]; groupHfid: number[];
return: bool; return: boolean;
siteId: number; siteId: number;
subregionId: number; subregionId: number;
} }
@ -1079,7 +1081,7 @@ export interface HistoricalEventHfsFormedIntrigueRelationship {
corruptorHfid: number; corruptorHfid: number;
corruptorIdentity: number; corruptorIdentity: number;
corruptorSeenAs: string; corruptorSeenAs: string;
failedJudgmentTest: bool; failedJudgmentTest: boolean;
featureLayerId: number; featureLayerId: number;
lureHfid: number; lureHfid: number;
method: string; method: string;
@ -1088,7 +1090,7 @@ export interface HistoricalEventHfsFormedIntrigueRelationship {
relevantPositionProfileId: number; relevantPositionProfileId: number;
siteId: number; siteId: number;
subregionId: number; subregionId: number;
successful: bool; successful: boolean;
targetHfid: number; targetHfid: number;
targetIdentity: number; targetIdentity: number;
targetSeenAs: string; targetSeenAs: string;
@ -1140,10 +1142,30 @@ export interface HistoricalEventItemStolenCircumstance {
type: string; type: string;
} }
export interface HistoricalEventKnowledgeDiscovered { export interface HistoricalEventKnowledgeDiscovered {
first: bool; first: boolean;
hfid: number; hfid: number;
knowledge: string; knowledge: string;
} }
export interface HistoricalEventMasterpieceItem {
entityId: number;
hfid: number;
itemId: number;
itemType: string;
maker: number;
makerEntity: number;
mat: string;
site: number;
siteId: number;
skillAtTime: string;
}
export interface HistoricalEventMerchant {
depotEntityId: number;
destination: number;
site: number;
siteId: number;
source: number;
traderEntityId: number;
}
export interface HistoricalEventModifiedBuilding { export interface HistoricalEventModifiedBuilding {
modification: string; modification: string;
modifierHfid: number; modifierHfid: number;
@ -1192,7 +1214,7 @@ export interface HistoricalEventPerformance {
export interface HistoricalEventPlunderedSite { export interface HistoricalEventPlunderedSite {
attackerCivId: number; attackerCivId: number;
defenderCivId: number; defenderCivId: number;
detected: bool; detected: boolean;
siteCivId: number; siteCivId: number;
siteId: number; siteId: number;
} }
@ -1289,6 +1311,32 @@ export interface HistoricalEventSiteTakenOver {
siteCivId: number; siteCivId: number;
siteId: number; siteId: number;
} }
export interface HistoricalEventSquadVsSquad {
aHfid: number;
aSquadId: number;
dEffect: number;
dInteraction: number;
dNumber: number;
dRace: number;
dSlain: number;
dSquadId: number;
featureLayerId: number;
siteId: number;
structureId: number;
subregionId: number;
}
export interface HistoricalEventTacticalSituation {
aTacticianHfid: number;
aTacticsRoll: number;
dTacticianHfid: number;
dTacticsRoll: number;
featureLayerId: number;
siteId: number;
situation: string;
start: boolean;
structureId: number;
subregionId: number;
}
export interface HistoricalEventTrade { export interface HistoricalEventTrade {
accountShift: number; accountShift: number;
allotment: number; allotment: number;
@ -1311,7 +1359,7 @@ export interface HistoricalEventWrittenContentComposed {
} }
export interface HistoricalFigure { export interface HistoricalFigure {
activeInteraction: string[]; activeInteraction: string[];
animated: bool; animated: boolean;
animatedString: string; animatedString: string;
appeared: number; appeared: number;
associatedType: string; associatedType: string;
@ -1321,14 +1369,14 @@ export interface HistoricalFigure {
currentIdentityId: number; currentIdentityId: number;
deathSeconds72: number; deathSeconds72: number;
deathYear: number; deathYear: number;
deity: bool; deity: boolean;
entPopId: number; entPopId: number;
entityFormerPositionLink: EntityFormerPositionLink[]; entityFormerPositionLink: EntityFormerPositionLink[];
entityLink: HistoricalFigureEntityLink[]; entityLink: HistoricalFigureEntityLink[];
entityPositionLink: EntityPositionLink[]; entityPositionLink: EntityPositionLink[];
entityReputation: EntityReputation[]; entityReputation: EntityReputation[];
entitySquadLink: EntitySquadLink; entitySquadLink: EntitySquadLink;
force: bool; force: boolean;
goal: string[]; goal: string[];
hfLink: HfLink[]; hfLink: HfLink[];
hfSkill: HfSkill[]; hfSkill: HfSkill[];
@ -1363,7 +1411,7 @@ export interface Honor {
exemptEpid: number; exemptEpid: number;
exemptFormerEpid: number; exemptFormerEpid: number;
givesPrecedence: number; givesPrecedence: number;
grantedToEverybody: bool; grantedToEverybody: boolean;
id: number; id: number;
name: string; name: string;
requiredBattles: number; requiredBattles: number;
@ -1371,7 +1419,7 @@ export interface Honor {
requiredSkill: string; requiredSkill: string;
requiredSkillIpTotal: number; requiredSkillIpTotal: number;
requiredYears: number; requiredYears: number;
requiresAnyMeleeOrRangedSkill: bool; requiresAnyMeleeOrRangedSkill: boolean;
} }
export interface HonorEntity { export interface HonorEntity {
battles: number; battles: number;
@ -1396,8 +1444,8 @@ export interface IntrigueActor {
handleActorId: number; handleActorId: number;
hfid: number; hfid: number;
localId: number; localId: number;
promisedActorImmortality: bool; promisedActorImmortality: boolean;
promisedMeImmortality: bool; promisedMeImmortality: boolean;
role: string; role: string;
strategy: string; strategy: string;
strategyEnid: number; strategyEnid: number;
@ -1410,10 +1458,10 @@ export interface IntriguePlot {
delegatedPlotId: number; delegatedPlotId: number;
entityId: number; entityId: number;
localId: number; localId: number;
onHold: bool; onHold: boolean;
parentPlotHfid: number; parentPlotHfid: number;
parentPlotId: number; parentPlotId: number;
plotActor: PlotActor[]; plotActor: PlotActor;
type: string; type: string;
} }
export interface Item { export interface Item {
@ -1432,7 +1480,7 @@ export interface MountainPeak {
coords: string; coords: string;
height: number; height: number;
id: number; id: number;
isVolcano: bool; isVolcano: boolean;
name: string; name: string;
} }
export interface MusicalForm { export interface MusicalForm {
@ -1448,7 +1496,7 @@ export interface Occasion {
} }
export interface PlotActor { export interface PlotActor {
actorId: number; actorId: number;
agreementHasMessenger: bool; agreementHasMessenger: boolean;
agreementId: number; agreementId: number;
plotRole: string; plotRole: string;
} }
@ -1552,20 +1600,20 @@ export interface UndergroundRegion {
type: string; type: string;
} }
export interface VagueRelationship { export interface VagueRelationship {
artisticBuddy: bool; artisticBuddy: boolean;
atheleticRival: bool; atheleticRival: boolean;
athleteBuddy: bool; athleteBuddy: boolean;
businessRival: bool; businessRival: boolean;
childhoodFriend: bool; childhoodFriend: boolean;
grudge: bool; grudge: boolean;
hfid: number; hfid: number;
jealousObsession: bool; jealousObsession: boolean;
jealousRelationshipGrudge: bool; jealousRelationshipGrudge: boolean;
persecutionGrudge: bool; persecutionGrudge: boolean;
religiousPersecutionGrudge: bool; religiousPersecutionGrudge: boolean;
scholarBuddy: bool; scholarBuddy: boolean;
supernaturalGrudge: bool; supernaturalGrudge: boolean;
warBuddy: bool; warBuddy: boolean;
} }
export interface WorldConstruction { export interface WorldConstruction {
coords: string; coords: string;