mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-22 07:32:32 +01:00
docs: add doc.go files and godoc comments to all packages
Add package-level documentation (doc.go) to all 22 first-party packages and godoc comments to ~150 previously undocumented exported symbols across common/, network/, and server/.
This commit is contained in:
5
common/mhfcourse/doc.go
Normal file
5
common/mhfcourse/doc.go
Normal file
@@ -0,0 +1,5 @@
|
||||
// Package mhfcourse models the subscription course system used by Monster
|
||||
// Hunter Frontier. Courses (Trial, HunterLife, Extra, Premium, etc.) are
|
||||
// represented as bit flags in a uint32 rights field and control which game
|
||||
// features a player can access.
|
||||
package mhfcourse
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
// Course represents an active subscription course with its ID and expiry time.
|
||||
type Course struct {
|
||||
ID uint16
|
||||
Expiry time.Time
|
||||
@@ -39,10 +40,12 @@ var aliases = map[uint16][]string{
|
||||
// 30 = Real NetCafe course
|
||||
}
|
||||
|
||||
// Aliases returns the human-readable names for this course (e.g. "HunterLife", "HL").
|
||||
func (c Course) Aliases() []string {
|
||||
return aliases[c.ID]
|
||||
}
|
||||
|
||||
// Courses returns all 32 possible course slots with zero-value expiry times.
|
||||
func Courses() []Course {
|
||||
courses := make([]Course, 32)
|
||||
for i := range courses {
|
||||
@@ -51,6 +54,7 @@ func Courses() []Course {
|
||||
return courses
|
||||
}
|
||||
|
||||
// Value returns the bitmask value for this course (2^ID).
|
||||
func (c Course) Value() uint32 {
|
||||
return uint32(math.Pow(2, float64(c.ID)))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user