1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-27 17:45:24 +00:00
OpenDiablo2/common
Robin Eklind 44a6a5672c common: convert objLookupRaw into a struct (#108)
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
2019-11-10 01:29:34 -05:00
..
AnimatedEntity.go Added support for all object layers. (#127) 2019-11-09 23:37:02 -05:00
AnimationData.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
animationmode_string.go common: use stringer and string2enum tools to convert back and forth between enum and string (#107) 2019-11-10 01:22:36 -05:00
Armor.go Load Armor.txt (#105) 2019-11-07 20:51:15 -05:00
BitMuncher.go Added support for all object layers. (#127) 2019-11-09 23:37:02 -05:00
BitStream_test.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
BitStream.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
BuildInfo.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
Cof.go common: use stringer and string2enum tools to convert back and forth between enum and string (#107) 2019-11-10 01:22:36 -05:00
ColorConvert.go More optimizations. Fixed button rendering issue. (#115) 2019-11-08 11:05:51 -05:00
Configuration.go Fixed some performance issues with binary reads. Moved config to its own spot. (#112) 2019-11-08 01:37:21 -05:00
DataDictionary.go Initial NPC support (#111) 2019-11-07 23:44:03 -05:00
Dcc.go Added support for all object layers. (#127) 2019-11-09 23:37:02 -05:00
Drawable.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
FileProvider.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
GameState.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
Hero.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
LevelPresets.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
LevelTypes.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
LevelWarp.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
Math.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
Missiles.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
MonStats.go Initial NPC support (#111) 2019-11-07 23:44:03 -05:00
MpqFileRecord.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
NPC.go Added support for all object layers. (#127) 2019-11-09 23:37:02 -05:00
Object.go Initial NPC support (#111) 2019-11-07 23:44:03 -05:00
ObjectLookup.go common: convert objLookupRaw into a struct (#108) 2019-11-10 01:29:34 -05:00
Objects.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
ObjectTypes.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
Palette.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
Path.go Initial NPC support (#111) 2019-11-07 23:44:03 -05:00
Rectangle.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
Sounds.go common: use inc closure to handle indices of SoundEntry props (#109) 2019-11-07 23:33:10 -05:00
Sprite.go common: generate atlas in y rather than x direction (#126) 2019-11-09 23:33:09 -05:00
StreamReader_test.go Fixed some performance issues with binary reads. Moved config to its own spot. (#112) 2019-11-08 01:37:21 -05:00
StreamReader.go Fixed some performance issues with binary reads. Moved config to its own spot. (#112) 2019-11-08 01:37:21 -05:00
StreamWriter_test.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
StreamWriter.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
StringUtils.go Lowercased all of the packages (#96) 2019-11-06 22:12:15 -05:00
TextDictionary.go Fixed some performance issues with binary reads. Moved config to its own spot. (#112) 2019-11-08 01:37:21 -05:00
UniqueItems.go fix build, rename Common to common (#99) 2019-11-06 23:50:20 -05:00
weaponclass_string.go common: use stringer and string2enum tools to convert back and forth between enum and string (#107) 2019-11-10 01:22:36 -05:00
weaponclass_string2enum.go common: use stringer and string2enum tools to convert back and forth between enum and string (#107) 2019-11-10 01:22:36 -05:00
Weapons.go More optimizations. Fixed button rendering issue. (#115) 2019-11-08 11:05:51 -05:00