From de116e8367ef5dc85eac6e396c722955fe44584b Mon Sep 17 00:00:00 2001 From: dk Date: Fri, 3 Jul 2020 15:33:46 -0700 Subject: [PATCH] moving package comments into doc.go files (#534) --- d2common/d2enum/doc.go | 3 +++ d2common/d2fileformats/d2cof/cof.go | 1 - d2common/d2fileformats/d2cof/doc.go | 2 ++ d2common/d2fileformats/d2dat/dat.go | 1 - d2common/d2fileformats/d2dat/doc.go | 2 ++ d2common/d2fileformats/d2dc6/dc6.go | 1 - d2common/d2fileformats/d2dc6/doc.go | 2 ++ d2common/d2fileformats/d2dcc/dcc.go | 1 - d2common/d2fileformats/d2dcc/doc.go | 2 ++ d2common/d2fileformats/d2ds1/doc.go | 2 ++ d2common/d2fileformats/d2ds1/ds1.go | 1 - d2common/d2fileformats/d2dt1/doc.go | 3 +++ d2common/d2fileformats/d2dt1/dt1.go | 2 -- d2common/d2fileformats/d2mpq/doc.go | 2 ++ d2common/d2fileformats/d2mpq/mpq.go | 1 - d2common/d2fileformats/d2pl2/doc.go | 2 ++ d2common/d2fileformats/d2pl2/pl2.go | 1 - d2common/d2interface/{d2interface.go => doc.go} | 0 d2common/d2math/doc.go | 2 ++ d2common/d2resource/doc.go | 2 ++ d2common/d2resource/resource_paths.go | 1 - d2common/doc.go | 3 +++ d2core/d2asset/d2asset.go | 3 --- d2core/d2asset/doc.go | 2 ++ d2core/d2config/config.go | 1 - d2core/d2config/doc.go | 2 ++ d2core/d2gui/doc.go | 2 ++ d2core/d2hero/doc.go | 2 ++ d2core/d2hero/hero_stats_state.go | 1 - d2core/d2input/doc.go | 2 ++ d2core/d2inventory/doc.go | 2 ++ d2core/d2map/d2mapengine/doc.go | 3 +++ d2core/d2map/d2mapentity/doc.go | 2 ++ d2core/d2map/d2mapgen/doc.go | 3 +++ d2core/d2map/d2maprenderer/doc.go | 2 ++ d2core/d2map/d2mapstamp/doc.go | 3 +++ d2core/d2screen/d2screen.go | 1 - d2core/d2screen/doc.go | 3 +++ d2core/d2term/doc.go | 3 +++ d2core/d2term/terminal.go | 1 - d2core/d2ui/doc.go | 3 +++ d2game/d2gamescreen/doc.go | 2 ++ d2game/d2player/doc.go | 2 ++ d2game/d2player/equipment_slot.go | 1 - d2networking/d2client/d2clientconnectiontype/doc.go | 3 +++ d2networking/d2client/d2localclient/doc.go | 2 ++ .../d2client/d2localclient/local_client_connection.go | 1 - d2networking/d2client/d2remoteclient/doc.go | 2 ++ .../d2remoteclient/remote_client_connection.go | 1 - d2networking/d2netpacket/d2netpackettype/doc.go | 11 +++++++++++ d2networking/d2netpacket/net_packet.go | 11 ----------- d2script/doc.go | 3 +++ 52 files changed, 86 insertions(+), 31 deletions(-) create mode 100644 d2common/d2enum/doc.go create mode 100644 d2common/d2fileformats/d2cof/doc.go create mode 100644 d2common/d2fileformats/d2dat/doc.go create mode 100644 d2common/d2fileformats/d2dc6/doc.go create mode 100644 d2common/d2fileformats/d2dcc/doc.go create mode 100644 d2common/d2fileformats/d2ds1/doc.go create mode 100644 d2common/d2fileformats/d2dt1/doc.go create mode 100644 d2common/d2fileformats/d2mpq/doc.go create mode 100644 d2common/d2fileformats/d2pl2/doc.go rename d2common/d2interface/{d2interface.go => doc.go} (100%) create mode 100644 d2common/d2math/doc.go create mode 100644 d2common/d2resource/doc.go create mode 100644 d2common/doc.go create mode 100644 d2core/d2asset/doc.go create mode 100644 d2core/d2config/doc.go create mode 100644 d2core/d2gui/doc.go create mode 100644 d2core/d2hero/doc.go create mode 100644 d2core/d2input/doc.go create mode 100644 d2core/d2inventory/doc.go create mode 100644 d2core/d2map/d2mapengine/doc.go create mode 100644 d2core/d2map/d2mapentity/doc.go create mode 100644 d2core/d2map/d2mapgen/doc.go create mode 100644 d2core/d2map/d2maprenderer/doc.go create mode 100644 d2core/d2map/d2mapstamp/doc.go create mode 100644 d2core/d2screen/doc.go create mode 100644 d2core/d2term/doc.go create mode 100644 d2core/d2ui/doc.go create mode 100644 d2game/d2gamescreen/doc.go create mode 100644 d2game/d2player/doc.go create mode 100644 d2networking/d2client/d2clientconnectiontype/doc.go create mode 100644 d2networking/d2client/d2localclient/doc.go create mode 100644 d2networking/d2client/d2remoteclient/doc.go create mode 100644 d2networking/d2netpacket/d2netpackettype/doc.go create mode 100644 d2script/doc.go diff --git a/d2common/d2enum/doc.go b/d2common/d2enum/doc.go new file mode 100644 index 00000000..7ccb5cc5 --- /dev/null +++ b/d2common/d2enum/doc.go @@ -0,0 +1,3 @@ +// Package d2enum provides enumerations used throughout +// the OpenDiablo2 codebase. +package d2enum diff --git a/d2common/d2fileformats/d2cof/cof.go b/d2common/d2fileformats/d2cof/cof.go index 7053d904..855b67ec 100644 --- a/d2common/d2fileformats/d2cof/cof.go +++ b/d2common/d2fileformats/d2cof/cof.go @@ -1,4 +1,3 @@ -// Package d2cof contains the logic for loading and processing COF files. package d2cof import ( diff --git a/d2common/d2fileformats/d2cof/doc.go b/d2common/d2fileformats/d2cof/doc.go new file mode 100644 index 00000000..d2496a8f --- /dev/null +++ b/d2common/d2fileformats/d2cof/doc.go @@ -0,0 +1,2 @@ +// Package d2cof contains the logic for loading and processing COF files. +package d2cof diff --git a/d2common/d2fileformats/d2dat/dat.go b/d2common/d2fileformats/d2dat/dat.go index 514075d2..0c9677bd 100644 --- a/d2common/d2fileformats/d2dat/dat.go +++ b/d2common/d2fileformats/d2dat/dat.go @@ -1,4 +1,3 @@ -// Package d2dat contains the logic for loading and processing DAT files. package d2dat // Load loads a DAT file. diff --git a/d2common/d2fileformats/d2dat/doc.go b/d2common/d2fileformats/d2dat/doc.go new file mode 100644 index 00000000..911877f8 --- /dev/null +++ b/d2common/d2fileformats/d2dat/doc.go @@ -0,0 +1,2 @@ +// Package d2dat contains the logic for loading and processing DAT files. +package d2dat diff --git a/d2common/d2fileformats/d2dc6/dc6.go b/d2common/d2fileformats/d2dc6/dc6.go index 886df74b..3146ccfb 100644 --- a/d2common/d2fileformats/d2dc6/dc6.go +++ b/d2common/d2fileformats/d2dc6/dc6.go @@ -1,4 +1,3 @@ -// Package d2dc6 contains the logic for loading and processing DC6 files. package d2dc6 import ( diff --git a/d2common/d2fileformats/d2dc6/doc.go b/d2common/d2fileformats/d2dc6/doc.go new file mode 100644 index 00000000..f981ea5f --- /dev/null +++ b/d2common/d2fileformats/d2dc6/doc.go @@ -0,0 +1,2 @@ +// Package d2dc6 contains the logic for loading and processing DC6 files. +package d2dc6 diff --git a/d2common/d2fileformats/d2dcc/dcc.go b/d2common/d2fileformats/d2dcc/dcc.go index 518257be..e136b080 100644 --- a/d2common/d2fileformats/d2dcc/dcc.go +++ b/d2common/d2fileformats/d2dcc/dcc.go @@ -1,4 +1,3 @@ -// Package d2dcc contains the logic for loading and processing DCC files. package d2dcc import ( diff --git a/d2common/d2fileformats/d2dcc/doc.go b/d2common/d2fileformats/d2dcc/doc.go new file mode 100644 index 00000000..d4c1ea0b --- /dev/null +++ b/d2common/d2fileformats/d2dcc/doc.go @@ -0,0 +1,2 @@ +// Package d2dcc contains the logic for loading and processing DCC files. +package d2dcc diff --git a/d2common/d2fileformats/d2ds1/doc.go b/d2common/d2fileformats/d2ds1/doc.go new file mode 100644 index 00000000..87277713 --- /dev/null +++ b/d2common/d2fileformats/d2ds1/doc.go @@ -0,0 +1,2 @@ +// Package d2ds1 provides functionality for loading/processing DS1 files +package d2ds1 diff --git a/d2common/d2fileformats/d2ds1/ds1.go b/d2common/d2fileformats/d2ds1/ds1.go index e2d76c94..2a0c74c7 100644 --- a/d2common/d2fileformats/d2ds1/ds1.go +++ b/d2common/d2fileformats/d2ds1/ds1.go @@ -1,4 +1,3 @@ -// Package d2ds1 provides functionality for loading/processing DS1 files package d2ds1 import ( diff --git a/d2common/d2fileformats/d2dt1/doc.go b/d2common/d2fileformats/d2dt1/doc.go new file mode 100644 index 00000000..19217d47 --- /dev/null +++ b/d2common/d2fileformats/d2dt1/doc.go @@ -0,0 +1,3 @@ +// Package d2dt1 provides functionality for loading/processing DT1 files. +// https://d2mods.info/forum/viewtopic.php?t=65163 +package d2dt1 diff --git a/d2common/d2fileformats/d2dt1/dt1.go b/d2common/d2fileformats/d2dt1/dt1.go index 5330670b..9c541b22 100644 --- a/d2common/d2fileformats/d2dt1/dt1.go +++ b/d2common/d2fileformats/d2dt1/dt1.go @@ -1,5 +1,3 @@ -// Package d2dt1 provides functionality for loading/processing DT1 files. -// https://d2mods.info/forum/viewtopic.php?t=65163 package d2dt1 import ( diff --git a/d2common/d2fileformats/d2mpq/doc.go b/d2common/d2fileformats/d2mpq/doc.go new file mode 100644 index 00000000..257c358b --- /dev/null +++ b/d2common/d2fileformats/d2mpq/doc.go @@ -0,0 +1,2 @@ +// Package d2mpq contains the functions for handling MPQ files. +package d2mpq diff --git a/d2common/d2fileformats/d2mpq/mpq.go b/d2common/d2fileformats/d2mpq/mpq.go index c30e23df..6dced931 100644 --- a/d2common/d2fileformats/d2mpq/mpq.go +++ b/d2common/d2fileformats/d2mpq/mpq.go @@ -1,4 +1,3 @@ -// Package d2mpq contains the functions for handling MPQ files. package d2mpq import ( diff --git a/d2common/d2fileformats/d2pl2/doc.go b/d2common/d2fileformats/d2pl2/doc.go new file mode 100644 index 00000000..9b84434c --- /dev/null +++ b/d2common/d2fileformats/d2pl2/doc.go @@ -0,0 +1,2 @@ +// Package d2pl2 handles processing of PL2 palette files. +package d2pl2 diff --git a/d2common/d2fileformats/d2pl2/pl2.go b/d2common/d2fileformats/d2pl2/pl2.go index e1585a81..2023cff0 100644 --- a/d2common/d2fileformats/d2pl2/pl2.go +++ b/d2common/d2fileformats/d2pl2/pl2.go @@ -1,4 +1,3 @@ -// Package d2pl2 handles processing of PL2 palette files. package d2pl2 import ( diff --git a/d2common/d2interface/d2interface.go b/d2common/d2interface/doc.go similarity index 100% rename from d2common/d2interface/d2interface.go rename to d2common/d2interface/doc.go diff --git a/d2common/d2math/doc.go b/d2common/d2math/doc.go new file mode 100644 index 00000000..88473ed0 --- /dev/null +++ b/d2common/d2math/doc.go @@ -0,0 +1,2 @@ +// Package d2math provides various math-related things +package d2math diff --git a/d2common/d2resource/doc.go b/d2common/d2resource/doc.go new file mode 100644 index 00000000..1ffdbb75 --- /dev/null +++ b/d2common/d2resource/doc.go @@ -0,0 +1,2 @@ +// Package d2resource stores the paths of the resources inside the mpq files. +package d2resource diff --git a/d2common/d2resource/resource_paths.go b/d2common/d2resource/resource_paths.go index a97b5676..bf71c51e 100644 --- a/d2common/d2resource/resource_paths.go +++ b/d2common/d2resource/resource_paths.go @@ -1,4 +1,3 @@ -// Package d2resource stores the paths of the resources inside the mpq files. package d2resource var LanguageCode string diff --git a/d2common/doc.go b/d2common/doc.go new file mode 100644 index 00000000..0c594daf --- /dev/null +++ b/d2common/doc.go @@ -0,0 +1,3 @@ +// Package d2common provides common stuff for all of the other +// high-level packages in the codebase +package d2common diff --git a/d2core/d2asset/d2asset.go b/d2core/d2asset/d2asset.go index e69657c5..16e2e4b3 100644 --- a/d2core/d2asset/d2asset.go +++ b/d2core/d2asset/d2asset.go @@ -1,6 +1,3 @@ -/* -Package d2asset has behaviors to load and save assets from disk. -*/ package d2asset import ( diff --git a/d2core/d2asset/doc.go b/d2core/d2asset/doc.go new file mode 100644 index 00000000..6373a97a --- /dev/null +++ b/d2core/d2asset/doc.go @@ -0,0 +1,2 @@ +// Package d2asset has behaviors to load and save assets from disk. +package d2asset diff --git a/d2core/d2config/config.go b/d2core/d2config/config.go index 4ab681f0..fc58e803 100644 --- a/d2core/d2config/config.go +++ b/d2core/d2config/config.go @@ -1,4 +1,3 @@ -// Package d2config contains configuration objects and functions package d2config import ( diff --git a/d2core/d2config/doc.go b/d2core/d2config/doc.go new file mode 100644 index 00000000..4eb0ae97 --- /dev/null +++ b/d2core/d2config/doc.go @@ -0,0 +1,2 @@ +// Package d2config contains configuration management for OpenDiablo2 +package d2config diff --git a/d2core/d2gui/doc.go b/d2core/d2gui/doc.go new file mode 100644 index 00000000..71a4ef3a --- /dev/null +++ b/d2core/d2gui/doc.go @@ -0,0 +1,2 @@ +// Package d2gui provides higher-level ui component management +package d2gui diff --git a/d2core/d2hero/doc.go b/d2core/d2hero/doc.go new file mode 100644 index 00000000..cff9e617 --- /dev/null +++ b/d2core/d2hero/doc.go @@ -0,0 +1,2 @@ +// Package d2hero utilities for managing a hero state. +package d2hero diff --git a/d2core/d2hero/hero_stats_state.go b/d2core/d2hero/hero_stats_state.go index 59f95593..64103f90 100644 --- a/d2core/d2hero/hero_stats_state.go +++ b/d2core/d2hero/hero_stats_state.go @@ -1,4 +1,3 @@ -// Package d2hero utilities for managing a hero state. package d2hero import ( diff --git a/d2core/d2input/doc.go b/d2core/d2input/doc.go new file mode 100644 index 00000000..2ac584c9 --- /dev/null +++ b/d2core/d2input/doc.go @@ -0,0 +1,2 @@ +// Package d2input provides an input manager +package d2input diff --git a/d2core/d2inventory/doc.go b/d2core/d2inventory/doc.go new file mode 100644 index 00000000..60c5eb5c --- /dev/null +++ b/d2core/d2inventory/doc.go @@ -0,0 +1,2 @@ +// Package d2inventory provides repreentations of player inventory +package d2inventory diff --git a/d2core/d2map/d2mapengine/doc.go b/d2core/d2map/d2mapengine/doc.go new file mode 100644 index 00000000..ba40c081 --- /dev/null +++ b/d2core/d2map/d2mapengine/doc.go @@ -0,0 +1,3 @@ +// Package d2mapengine provides a map engine, something that +// can place diablo tile data onto a plane. +package d2mapengine diff --git a/d2core/d2map/d2mapentity/doc.go b/d2core/d2map/d2mapentity/doc.go new file mode 100644 index 00000000..18fe87cb --- /dev/null +++ b/d2core/d2map/d2mapentity/doc.go @@ -0,0 +1,2 @@ +// Package d2mapentity provides representations of map entities +package d2mapentity diff --git a/d2core/d2map/d2mapgen/doc.go b/d2core/d2map/d2mapgen/doc.go new file mode 100644 index 00000000..bfd164c9 --- /dev/null +++ b/d2core/d2map/d2mapgen/doc.go @@ -0,0 +1,3 @@ +// Package d2mapgen provides map generator implementations +// for use with the map engine +package d2mapgen diff --git a/d2core/d2map/d2maprenderer/doc.go b/d2core/d2map/d2maprenderer/doc.go new file mode 100644 index 00000000..d16514c0 --- /dev/null +++ b/d2core/d2map/d2maprenderer/doc.go @@ -0,0 +1,2 @@ +// Package d2maprenderer provides a renderer for the map engine +package d2maprenderer diff --git a/d2core/d2map/d2mapstamp/doc.go b/d2core/d2map/d2mapstamp/doc.go new file mode 100644 index 00000000..03313fbc --- /dev/null +++ b/d2core/d2map/d2mapstamp/doc.go @@ -0,0 +1,3 @@ +// Package d2mapstamp provides a representation of a preset map +// which can be used "like a stamp" by the map engine +package d2mapstamp diff --git a/d2core/d2screen/d2screen.go b/d2core/d2screen/d2screen.go index e43cdacf..393bc457 100644 --- a/d2core/d2screen/d2screen.go +++ b/d2core/d2screen/d2screen.go @@ -1,4 +1,3 @@ -// Package d2screen contains the interface for screens package d2screen import ( diff --git a/d2core/d2screen/doc.go b/d2core/d2screen/doc.go new file mode 100644 index 00000000..e8edbc3d --- /dev/null +++ b/d2core/d2screen/doc.go @@ -0,0 +1,3 @@ +// Package d2screen provides a means of defining and +// transitioning between game screens +package d2screen diff --git a/d2core/d2term/doc.go b/d2core/d2term/doc.go new file mode 100644 index 00000000..56ee8f42 --- /dev/null +++ b/d2core/d2term/doc.go @@ -0,0 +1,3 @@ +// Package d2term provides a in-game terminal that allows +// executing custom commands for debugging +package d2term diff --git a/d2core/d2term/terminal.go b/d2core/d2term/terminal.go index c5524f45..3bef3226 100644 --- a/d2core/d2term/terminal.go +++ b/d2core/d2term/terminal.go @@ -1,4 +1,3 @@ -// Package d2term provides a in-game terminal that allows executing custom commands for debugging package d2term import ( diff --git a/d2core/d2ui/doc.go b/d2core/d2ui/doc.go new file mode 100644 index 00000000..38e95196 --- /dev/null +++ b/d2core/d2ui/doc.go @@ -0,0 +1,3 @@ +// Package d2ui provides ui elements like buttons, scrollbars, +// checkboxes, text labels, etc. +package d2ui diff --git a/d2game/d2gamescreen/doc.go b/d2game/d2gamescreen/doc.go new file mode 100644 index 00000000..511f2bbe --- /dev/null +++ b/d2game/d2gamescreen/doc.go @@ -0,0 +1,2 @@ +// Package d2gamescreen is where the game screens are defined +package d2gamescreen diff --git a/d2game/d2player/doc.go b/d2game/d2player/doc.go new file mode 100644 index 00000000..e9e86550 --- /dev/null +++ b/d2game/d2player/doc.go @@ -0,0 +1,2 @@ +// Package d2player contains the information necessary for managing players +package d2player diff --git a/d2game/d2player/equipment_slot.go b/d2game/d2player/equipment_slot.go index 60fee39a..8ad26ede 100644 --- a/d2game/d2player/equipment_slot.go +++ b/d2game/d2player/equipment_slot.go @@ -1,4 +1,3 @@ -// Package d2player contains the information necessary for managing players package d2player import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum" diff --git a/d2networking/d2client/d2clientconnectiontype/doc.go b/d2networking/d2client/d2clientconnectiontype/doc.go new file mode 100644 index 00000000..278238e8 --- /dev/null +++ b/d2networking/d2client/d2clientconnectiontype/doc.go @@ -0,0 +1,3 @@ +// Package d2clientconnectiontype provides types +// for client connections +package d2clientconnectiontype diff --git a/d2networking/d2client/d2localclient/doc.go b/d2networking/d2client/d2localclient/doc.go new file mode 100644 index 00000000..59b37507 --- /dev/null +++ b/d2networking/d2client/d2localclient/doc.go @@ -0,0 +1,2 @@ +// Package d2localclient facilitates communication between a local client and server. +package d2localclient diff --git a/d2networking/d2client/d2localclient/local_client_connection.go b/d2networking/d2client/d2localclient/local_client_connection.go index 1b4f6403..bc3fad2f 100644 --- a/d2networking/d2client/d2localclient/local_client_connection.go +++ b/d2networking/d2client/d2localclient/local_client_connection.go @@ -1,4 +1,3 @@ -// Package d2localclient facilitates communication between a local client and server. package d2localclient import ( diff --git a/d2networking/d2client/d2remoteclient/doc.go b/d2networking/d2client/d2remoteclient/doc.go new file mode 100644 index 00000000..979cab12 --- /dev/null +++ b/d2networking/d2client/d2remoteclient/doc.go @@ -0,0 +1,2 @@ +// Package d2remoteclient facilitates communication between a remote client and server. +package d2remoteclient diff --git a/d2networking/d2client/d2remoteclient/remote_client_connection.go b/d2networking/d2client/d2remoteclient/remote_client_connection.go index c1580cb2..8b31cf14 100644 --- a/d2networking/d2client/d2remoteclient/remote_client_connection.go +++ b/d2networking/d2client/d2remoteclient/remote_client_connection.go @@ -1,4 +1,3 @@ -// Package d2remoteclient facilitates communication between a remote client and server. package d2remoteclient import ( diff --git a/d2networking/d2netpacket/d2netpackettype/doc.go b/d2networking/d2netpacket/d2netpackettype/doc.go new file mode 100644 index 00000000..d3e38641 --- /dev/null +++ b/d2networking/d2netpacket/d2netpackettype/doc.go @@ -0,0 +1,11 @@ +// Package d2netpackettype defines types which are encoded to JSON and sent in network +// packet payloads. +// Package d2netpacket/d2netpackettype defines a uint32 enumerable representing each +// packet type. +// +// A struct is defined for each packet type. Each struct comes with a function which +// returns a NetPacket declaring the type enum (header) followed by the associated +// struct (body). The NetPacket is marshaled to JSON for transport. On receipt of +// the packet, the enum is read as a single byte then the remaining data (the struct) +// is unmarshalled to the type associated with the type enum. +package d2netpackettype diff --git a/d2networking/d2netpacket/net_packet.go b/d2networking/d2netpacket/net_packet.go index 36b555d6..4c19536a 100644 --- a/d2networking/d2netpacket/net_packet.go +++ b/d2networking/d2netpacket/net_packet.go @@ -1,14 +1,3 @@ -// Package d2netpacket defines types which are encoded to JSON and sent in network -// packet payloads. -/* -Package d2netpacket/d2netpackettype defines a uint32 enumerable representing each -packet type. - -A struct is defined for each packet type. Each struct comes with a function which -returns a NetPacket declaring the type enum (header) followed by the associated -struct (body). The NetPacket is marshalled to JSON for transport. On receipt of -the packet, the enum is read as a single byte then the remaining data (the struct) -is unmarshalled to the type associated with the type enum.*/ package d2netpacket import "github.com/OpenDiablo2/OpenDiablo2/d2networking/d2netpacket/d2netpackettype" diff --git a/d2script/doc.go b/d2script/doc.go new file mode 100644 index 00000000..fd1c9e9d --- /dev/null +++ b/d2script/doc.go @@ -0,0 +1,3 @@ +// Package d2script provides a virtual machine for +// interpretting scripts +package d2script