This commit is contained in:
Robert Janetzko 2022-04-24 08:10:34 +00:00
parent b97f4a750f
commit 7cbdb55fbf
4 changed files with 58 additions and 47 deletions

View File

@ -11,6 +11,12 @@
"HistoricalEventAddHfSiteLink": { "HistoricalEventAddHfSiteLink": {
"Site": "SiteId" "Site": "SiteId"
}, },
"HistoricalEventAgreementMade": {
"Site": "SiteId"
},
"HistoricalEventAgreementRejected": {
"Site": "SiteId"
},
"HistoricalEventArtifactCreated": { "HistoricalEventArtifactCreated": {
"CreatorHfid": "HistFigureId", "CreatorHfid": "HistFigureId",
"CreatorUnitId": "UnitId", "CreatorUnitId": "UnitId",

View File

@ -119,16 +119,45 @@ func (x *HistoricalEventAddHfSiteLink) Html(c *context) string {
} }
} }
func (x *HistoricalEventAgreementConcluded) Html(c *context) string { // TODO wording
r := ""
switch x.Topic {
case HistoricalEventAgreementConcludedTopic_Treequota:
r += "a lumber agreement"
}
return r + " proposed by " + entity(x.Source) + " was concluded by " + entity(x.Destination) + site(x.Site, " at")
}
func (x *HistoricalEventAgreementFormed) Html(c *context) string { // TODO func (x *HistoricalEventAgreementFormed) Html(c *context) string { // TODO
return "UNKNWON HistoricalEventAgreementFormed" return "UNKNWON HistoricalEventAgreementFormed"
} }
func (x *HistoricalEventAgreementMade) Html(c *context) string { // TODO func (x *HistoricalEventAgreementMade) Html(c *context) string {
return "UNKNWON HistoricalEventAgreementMade" r := ""
switch x.Topic {
case HistoricalEventAgreementMadeTopic_Becomelandholder:
r += "the establishment of landed nobility"
case HistoricalEventAgreementMadeTopic_Promotelandholder:
r += "the elevation of landed nobility"
case HistoricalEventAgreementMadeTopic_Treequota:
r += "a lumber agreement"
}
return r + " proposed by " + entity(x.Source) + " was accepted by " + entity(x.Destination) + site(x.SiteId, " at")
} }
func (x *HistoricalEventAgreementRejected) Html(c *context) string { // TODO func (x *HistoricalEventAgreementRejected) Html(c *context) string {
return "UNKNWON HistoricalEventAgreementRejected" r := ""
switch x.Topic {
case HistoricalEventAgreementRejectedTopic_Becomelandholder:
r += "the establishment of landed nobility"
case HistoricalEventAgreementRejectedTopic_Treequota:
r += "a lumber agreement"
case HistoricalEventAgreementRejectedTopic_Tributeagreement:
r += "a tribute agreement"
case HistoricalEventAgreementRejectedTopic_Unknown10:
r += "a demand of unconditional surrender"
}
return r + " proposed by " + entity(x.Source) + " was rejected by " + entity(x.Destination) + site(x.SiteId, " at")
} }
func (x *HistoricalEventArtifactClaimFormed) Html(c *context) string { func (x *HistoricalEventArtifactClaimFormed) Html(c *context) string {
@ -1131,18 +1160,23 @@ func (x *HistoricalEventInsurrectionStarted) Html(c *context) string {
func (x *HistoricalEventItemStolen) Html(c *context) string { func (x *HistoricalEventItemStolen) Html(c *context) string {
i := util.If(x.Item != -1, artifact(x.Item), articled(x.Mat+" "+x.ItemType)) i := util.If(x.Item != -1, artifact(x.Item), articled(x.Mat+" "+x.ItemType))
circumstance := "" circumstance := ""
switch x.Circumstance.Type { if x.Circumstance != nil {
case HistoricalEventItemStolenCircumstanceType_Defeated: switch x.Circumstance.Type {
circumstance = " after defeating " + c.hfRelated(x.Circumstance.Defeated, x.Histfig) case HistoricalEventItemStolenCircumstanceType_Defeated:
case HistoricalEventItemStolenCircumstanceType_Histeventcollection: circumstance = " after defeating " + c.hfRelated(x.Circumstance.Defeated, x.Histfig)
case HistoricalEventItemStolenCircumstanceType_Murdered: case HistoricalEventItemStolenCircumstanceType_Histeventcollection: // TODO during ...
case HistoricalEventItemStolenCircumstanceType_Murdered:
circumstance = " after murdering " + c.hfRelated(x.Circumstance.Defeated, x.Histfig)
}
} }
switch x.TheftMethod { switch x.TheftMethod {
case HistoricalEventItemStolenTheftMethod_Confiscated: // TODO case HistoricalEventItemStolenTheftMethod_Confiscated:
return i + " was confiscated by " + c.hf(x.Histfig) + circumstance + util.If(x.Site != -1, site(x.Site, " in"), "")
case HistoricalEventItemStolenTheftMethod_Looted: case HistoricalEventItemStolenTheftMethod_Looted:
return i + " was looted " + util.If(x.Site != -1, site(x.Site, " from"), "") + " by " + c.hf(x.Histfig) + circumstance
case HistoricalEventItemStolenTheftMethod_Recovered: case HistoricalEventItemStolenTheftMethod_Recovered:
return i + " was recovered by " + c.hf(x.Histfig) + circumstance return i + " was recovered by " + c.hf(x.Histfig) + circumstance + util.If(x.Site != -1, site(x.Site, " in"), "")
} }
return i + " was stolen " + siteStructure(x.Site, x.Structure, "from") + " by " + c.hf(x.Histfig) + circumstance + return i + " was stolen " + siteStructure(x.Site, x.Structure, "from") + " by " + c.hf(x.Histfig) + circumstance +
util.If(x.StashSite != -1, " and brought "+site(x.StashSite, "to"), "") util.If(x.StashSite != -1, " and brought "+site(x.StashSite, "to"), "")
@ -1155,6 +1189,9 @@ func (x *HistoricalEventKnowledgeDiscovered) Html(c *context) string {
func (x *HistoricalEventMasterpieceArchConstructed) Html(c *context) string { func (x *HistoricalEventMasterpieceArchConstructed) Html(c *context) string {
return "UNKNWON HistoricalEventMasterpieceArchConstructed" return "UNKNWON HistoricalEventMasterpieceArchConstructed"
} }
func (x *HistoricalEventMasterpieceDye) Html(c *context) string { // TODO
return "UNKNWON HistoricalEventMasterpieceDye"
}
func (x *HistoricalEventMasterpieceEngraving) Html(c *context) string { func (x *HistoricalEventMasterpieceEngraving) Html(c *context) string {
return "UNKNWON HistoricalEventMasterpieceEngraving" return "UNKNWON HistoricalEventMasterpieceEngraving"
} }
@ -1372,10 +1409,3 @@ func (x *HistoricalEventWrittenContentComposed) Html(c *context) string {
} }
return writtenContent(x.WcId) + " was authored by " + c.hf(x.HistFigureId) + location(x.SiteId, " in", x.SubregionId, " in") + reason + circumstance return writtenContent(x.WcId) + " was authored by " + c.hf(x.HistFigureId) + location(x.SiteId, " in", x.SubregionId, " in") + reason + circumstance
} }
func (x *HistoricalEventAgreementConcluded) Html(c *context) string { // TODO
return "UNKNWON HistoricalEventAgreementConcluded"
}
func (x *HistoricalEventMasterpieceDye) Html(c *context) string { // TODO
return "UNKNWON HistoricalEventMasterpieceDye"
}

View File

@ -3751,7 +3751,6 @@ func (s HistoricalEventAgreementMadeTopic) MarshalJSON() ([]byte, error) {
type HistoricalEventAgreementMade struct { type HistoricalEventAgreementMade struct {
Destination int `json:"destination" legend:"plus"` // destination Destination int `json:"destination" legend:"plus"` // destination
Site int `json:"site" legend:"plus"` // site
SiteId int `json:"siteId" legend:"base"` // site_id SiteId int `json:"siteId" legend:"base"` // site_id
Source int `json:"source" legend:"plus"` // source Source int `json:"source" legend:"plus"` // source
Topic HistoricalEventAgreementMadeTopic `json:"topic" legend:"plus"` // topic Topic HistoricalEventAgreementMadeTopic `json:"topic" legend:"plus"` // topic
@ -3760,7 +3759,6 @@ type HistoricalEventAgreementMade struct {
func NewHistoricalEventAgreementMade() *HistoricalEventAgreementMade { func NewHistoricalEventAgreementMade() *HistoricalEventAgreementMade {
return &HistoricalEventAgreementMade{ return &HistoricalEventAgreementMade{
Destination: -1, Destination: -1,
Site: -1,
SiteId: -1, SiteId: -1,
Source: -1, Source: -1,
} }
@ -3776,9 +3774,6 @@ func (x *HistoricalEventAgreementMade) CheckFields() {
if x.Destination != x.SiteId { if x.Destination != x.SiteId {
sameFields["HistoricalEventAgreementMade"]["Destination"]["SiteId"] = false sameFields["HistoricalEventAgreementMade"]["Destination"]["SiteId"] = false
} }
if x.Site != x.SiteId {
sameFields["HistoricalEventAgreementMade"]["Site"]["SiteId"] = false
}
if x.Source != x.SiteId { if x.Source != x.SiteId {
sameFields["HistoricalEventAgreementMade"]["Source"]["SiteId"] = false sameFields["HistoricalEventAgreementMade"]["Source"]["SiteId"] = false
} }
@ -3789,9 +3784,6 @@ func (x *HistoricalEventAgreementMade) MarshalJSON() ([]byte, error) {
if x.Destination != -1 { if x.Destination != -1 {
d["destination"] = x.Destination d["destination"] = x.Destination
} }
if x.Site != -1 {
d["site"] = x.Site
}
if x.SiteId != -1 { if x.SiteId != -1 {
d["siteId"] = x.SiteId d["siteId"] = x.SiteId
} }
@ -3848,7 +3840,6 @@ func (s HistoricalEventAgreementRejectedTopic) MarshalJSON() ([]byte, error) {
type HistoricalEventAgreementRejected struct { type HistoricalEventAgreementRejected struct {
Destination int `json:"destination" legend:"plus"` // destination Destination int `json:"destination" legend:"plus"` // destination
Site int `json:"site" legend:"plus"` // site
SiteId int `json:"siteId" legend:"base"` // site_id SiteId int `json:"siteId" legend:"base"` // site_id
Source int `json:"source" legend:"plus"` // source Source int `json:"source" legend:"plus"` // source
Topic HistoricalEventAgreementRejectedTopic `json:"topic" legend:"plus"` // topic Topic HistoricalEventAgreementRejectedTopic `json:"topic" legend:"plus"` // topic
@ -3857,7 +3848,6 @@ type HistoricalEventAgreementRejected struct {
func NewHistoricalEventAgreementRejected() *HistoricalEventAgreementRejected { func NewHistoricalEventAgreementRejected() *HistoricalEventAgreementRejected {
return &HistoricalEventAgreementRejected{ return &HistoricalEventAgreementRejected{
Destination: -1, Destination: -1,
Site: -1,
SiteId: -1, SiteId: -1,
Source: -1, Source: -1,
} }
@ -3873,9 +3863,6 @@ func (x *HistoricalEventAgreementRejected) CheckFields() {
if x.Destination != x.SiteId { if x.Destination != x.SiteId {
sameFields["HistoricalEventAgreementRejected"]["Destination"]["SiteId"] = false sameFields["HistoricalEventAgreementRejected"]["Destination"]["SiteId"] = false
} }
if x.Site != x.SiteId {
sameFields["HistoricalEventAgreementRejected"]["Site"]["SiteId"] = false
}
if x.Source != x.SiteId { if x.Source != x.SiteId {
sameFields["HistoricalEventAgreementRejected"]["Source"]["SiteId"] = false sameFields["HistoricalEventAgreementRejected"]["Source"]["SiteId"] = false
} }
@ -3886,9 +3873,6 @@ func (x *HistoricalEventAgreementRejected) MarshalJSON() ([]byte, error) {
if x.Destination != -1 { if x.Destination != -1 {
d["destination"] = x.Destination d["destination"] = x.Destination
} }
if x.Site != -1 {
d["site"] = x.Site
}
if x.SiteId != -1 { if x.SiteId != -1 {
d["siteId"] = x.SiteId d["siteId"] = x.SiteId
} }
@ -22480,7 +22464,7 @@ func parseHistoricalEventAgreementMadePlus(p *util.XMLParser, obj *HistoricalEve
if err != nil { if err != nil {
return nil, err return nil, err
} }
obj.Site = num(data) obj.SiteId = num(data)
case "source": case "source":
data, err := p.Value() data, err := p.Value()
if err != nil { if err != nil {
@ -22556,7 +22540,7 @@ func parseHistoricalEventAgreementRejectedPlus(p *util.XMLParser, obj *Historica
if err != nil { if err != nil {
return nil, err return nil, err
} }
obj.Site = num(data) obj.SiteId = num(data)
case "source": case "source":
data, err := p.Value() data, err := p.Value()
if err != nil { if err != nil {

View File

@ -6,25 +6,16 @@
"Site": "SiteId" "Site": "SiteId"
}, },
"HistoricalEventAgreementMade": { "HistoricalEventAgreementMade": {
"Destination": "SiteId", "Site": "SiteId"
"Site": "SiteId",
"Source": "SiteId"
}, },
"HistoricalEventAgreementRejected": { "HistoricalEventAgreementRejected": {
"Destination": "SiteId", "Site": "SiteId"
"Site": "SiteId",
"Source": "SiteId"
}, },
"HistoricalEventDiplomatLost": { "HistoricalEventDiplomatLost": {
"Entity": "SiteId", "Entity": "SiteId",
"Involved": "SiteId", "Involved": "SiteId",
"Site": "SiteId" "Site": "SiteId"
}, },
"HistoricalEventHfDied": {
"ItemSubtype": "Cause",
"Mat": "Cause",
"ShooterMat": "Cause"
},
"HistoricalEventPeaceAccepted": { "HistoricalEventPeaceAccepted": {
"Site": "SiteId" "Site": "SiteId"
}, },