1
0
forked from MTSR/mapserver

import cleanup

This commit is contained in:
Thomas Rudin 2019-01-07 08:59:06 +01:00
parent d916f0e03c
commit db6e436b14
3 changed files with 18 additions and 17 deletions

View File

@ -7,3 +7,20 @@ type MapBlock struct {
Mapdata []byte Mapdata []byte
Metadata Metadata Metadata Metadata
} }
type Metadata struct {
Inventories map[int]map[string]Inventory
Pairs map[int]map[string]string
}
type Item struct {
Name string
Count int
Wear int
}
type Inventory struct {
Size int
Items []Item
}

View File

@ -9,21 +9,6 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
type Metadata struct {
Inventories map[int]map[string]Inventory
Pairs map[int]map[string]string
}
type Item struct {
Name string
Count int
Wear int
}
type Inventory struct {
Size int
Items []Item
}
func readU16(data []byte, offset int) int { func readU16(data []byte, offset int) int {
return (int(data[offset]) << 8) | int(data[offset + 1]) return (int(data[offset]) << 8) | int(data[offset + 1])

View File

@ -4,7 +4,6 @@ import (
"testing" "testing"
"io/ioutil" "io/ioutil"
"strconv" "strconv"
mapblockparser "mapserver/mapblockparser"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
@ -16,7 +15,7 @@ func TestParse(t *testing.T){
t.Error(err) t.Error(err)
} }
mapblock, err := mapblockparser.Parse(data) mapblock, err := Parse(data)
if err != nil { if err != nil {
t.Error(err) t.Error(err)