Skip to content

Commit

Permalink
Package structure (#8):
Browse files Browse the repository at this point in the history
- move stats.go into d2sstats package (finally close #8)
  • Loading branch information
gucio321 committed May 17, 2021
1 parent 25ff8de commit 70254c6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 3 additions & 2 deletions d2s.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/gucio321/d2d2s/d2smercenary"
"github.com/gucio321/d2d2s/d2snpc"
"github.com/gucio321/d2d2s/d2squests"
"github.com/gucio321/d2d2s/d2sstats"
"github.com/gucio321/d2d2s/d2sstatus"
"github.com/gucio321/d2d2s/d2swaypoints"
"github.com/gucio321/d2d2s/datautils"
Expand Down Expand Up @@ -64,7 +65,7 @@ type D2S struct {
Quests *d2squests.Quests
Waypoints *d2swaypoints.Waypoints
NPC *d2snpc.NPC
Stats *Stats
Stats *d2sstats.Stats
Skills [numSkills]d2senums.SkillID
Items *d2sitems.Items
Corpse *d2scorpse.Corpse
Expand All @@ -82,7 +83,7 @@ func New() *D2S {
Quests: d2squests.New(),
Waypoints: d2swaypoints.New(),
NPC: d2snpc.New(),
Stats: &Stats{},
Stats: d2sstats.New(),
Items: &d2sitems.Items{},
Corpse: d2scorpse.New(),
IronGolem: d2sirongolem.New(),
Expand Down
2 changes: 2 additions & 0 deletions d2sstats/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package d2sstats provides stats list structure
package d2sstats
8 changes: 7 additions & 1 deletion stats.go → d2sstats/stats.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package d2d2s
package d2sstats

import (
"errors"
Expand Down Expand Up @@ -32,6 +32,12 @@ type Stats struct {
StashedGold uint64
}

// New creates a new stats list
func New() *Stats {
result := &Stats{}
return result
}

// Load loads hero stats
// nolint:gocyclo // can't reduce (switch-case)
func (s *Stats) Load(sr *datautils.BitMuncher) error {
Expand Down

0 comments on commit 70254c6

Please sign in to comment.