mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2025-02-05 16:17:45 -05:00
44a6a5672c
Ain't noone got time for that :) So, we automated it: a.sh: script automating the work a.go: tool to pretty print the parsed ObjectLookups b.go: output of a.go c.go: compare before and after rewrite to ensure they are identical a.go: https://play.golang.org/p/P8G1byhzMtY b.go: output of `go run a.go` c:go: https://play.golang.org/p/q8LXBbBhkp5 a.sh contents follows below: #!/bin/bash # go get golang.org/x/tools/cmd/goimports # go get github.com/mewkiz/cmd/sar echo -n -e "//+build ignore\n\npackage common\n\nvar ObjectLookups = " > b.go go run a.go >> b.go sar -i '[A-Za-z_][A-Za-z0-9_]*:[\"][\"],' '' b.go sar -i 'Type:1,' 'Type:ObjectTypeCharacter,' b.go sar -i 'Type:2,' 'Type:ObjectTypeItem,' b.go sar -i 'common.ObjectLookupRecord' 'ObjectLookupRecord' b.go goimports -w b.go |
||
---|---|---|
.. | ||
Engine.go |