1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-24 08:05:24 +00:00
OpenDiablo2/d2core/d2hero/hero_state.go
Thomas Christlieb 40cc421f51
Saving and loading game data, Fixes #868 #799 (#883)
* saving of player should be done on the server. That's also where the loading happens.

* refactor nearly everything, but this time it looks not that bad...

* MAke Linter happy

* Typo... uuups
2020-10-31 14:30:08 -04:00

23 lines
915 B
Go

package d2hero
import (
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum"
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2inventory"
)
// HeroState stores the state of the player
type HeroState struct {
HeroName string `json:"heroName"`
HeroType d2enum.Hero `json:"heroType"`
HeroLevel int `json:"heroLevel"`
Act int `json:"act"`
FilePath string `json:"-"`
Equipment d2inventory.CharacterEquipment `json:"equipment"`
Stats *HeroStatsState `json:"stats"`
Skills map[int]*HeroSkill `json:"skills"`
X float64 `json:"x"`
Y float64 `json:"y"`
LeftSkill int `json:"leftSkill"`
RightSkill int `json:"rightSkill"`
}