✨ Parse (but don't return) instances
This commit is contained in:
parent
03fa525a00
commit
d55c680ec4
3 changed files with 14 additions and 7 deletions
|
|
@ -5,6 +5,6 @@ type Game struct {
|
|||
Version string `json:"version"`
|
||||
Created int64 `json:"created"`
|
||||
Updated int64 `json:"updated"`
|
||||
Instances []any `json:"instances" db:"-"`
|
||||
Instances []Instance `json:"instances" db:"-"`
|
||||
Items []Item `json:"items" db:"-"`
|
||||
}
|
||||
|
|
|
|||
7
infinitecraft/instance.go
Normal file
7
infinitecraft/instance.go
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
package infinitecraft
|
||||
|
||||
type Instance struct {
|
||||
ItemID int32 `json:"itemId"`
|
||||
X uint16 `json:"x"`
|
||||
Y uint16 `json:"y"`
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ func (m *Merger) Write(ctx context.Context, g Game) (out string, err error) {
|
|||
gz.Comment = "merge by ic-merge"
|
||||
|
||||
if g.Instances == nil {
|
||||
g.Instances = make([]any, 0)
|
||||
g.Instances = make([]Instance, 0)
|
||||
}
|
||||
|
||||
enc := json.NewEncoder(gz)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue