Skip to content

Commit

Permalink
package structure (#8):
Browse files Browse the repository at this point in the history
- move status.go into d2sstatus package
  • Loading branch information
gucio321 committed May 17, 2021
1 parent 2780bad commit 25ff8de
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/d2sstatus"
"github.com/gucio321/d2d2s/d2swaypoints"
"github.com/gucio321/d2d2s/datautils"
)
Expand All @@ -40,7 +41,7 @@ type D2S struct {
Version d2senums.Version
unknown1 uint32
Name string
Status *Status
Status *d2sstatus.Status
Progression byte
unknown2 uint16
Class d2senums.CharacterClass
Expand Down Expand Up @@ -74,7 +75,7 @@ type D2S struct {
// New creates a new D2S structure
func New() *D2S {
result := &D2S{
Status: &Status{},
Status: d2sstatus.New(),
Hotkeys: make(hotkeys),
Difficulty: d2sdifficulty.New(),
Mercenary: d2smercenary.New(),
Expand Down
2 changes: 2 additions & 0 deletions d2sstatus/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// Package d2sstatus provides basic character status structure
package d2sstatus
8 changes: 7 additions & 1 deletion status.go → d2sstatus/status.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package d2d2s
package d2sstatus

import (
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2datautils"
Expand All @@ -18,6 +18,12 @@ type Status struct {
Unknown7 bool
}

// New creates a new status structure
func New() *Status {
result := &Status{}
return result
}

// Unmarshal loads data into status structure
func (s *Status) Unmarshal(data byte) {
bm := datautils.CreateBitMuncher([]byte{data}, 0)
Expand Down

0 comments on commit 25ff8de

Please sign in to comment.