✨ Parse (but don't return) instances
This commit is contained in:
parent
03fa525a00
commit
d55c680ec4
3 changed files with 14 additions and 7 deletions
|
|
@ -1,10 +1,10 @@
|
||||||
package infinitecraft
|
package infinitecraft
|
||||||
|
|
||||||
type Game struct {
|
type Game struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
Created int64 `json:"created"`
|
Created int64 `json:"created"`
|
||||||
Updated int64 `json:"updated"`
|
Updated int64 `json:"updated"`
|
||||||
Instances []any `json:"instances" db:"-"`
|
Instances []Instance `json:"instances" db:"-"`
|
||||||
Items []Item `json:"items" 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"
|
gz.Comment = "merge by ic-merge"
|
||||||
|
|
||||||
if g.Instances == nil {
|
if g.Instances == nil {
|
||||||
g.Instances = make([]any, 0)
|
g.Instances = make([]Instance, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
enc := json.NewEncoder(gz)
|
enc := json.NewEncoder(gz)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue