Add layers on stats and small refactor
This commit is contained in:
@@ -118,7 +118,7 @@ type PlayerUnit struct {
|
||||
Name string
|
||||
Area area.Area
|
||||
Position Position
|
||||
Stats map[stat.Stat]int
|
||||
Stats map[stat.ID]int
|
||||
Skills map[skill.Skill]int
|
||||
States state.States
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ type Item struct {
|
||||
Position Position
|
||||
Ethereal bool
|
||||
IsHovered bool
|
||||
Stats map[stat.Stat]int
|
||||
Stats map[stat.ID]stat.Data
|
||||
Identified bool
|
||||
IsVendor bool
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ type Monster struct {
|
||||
Name npc.ID
|
||||
IsHovered bool
|
||||
Position Position
|
||||
Stats map[stat.Stat]int
|
||||
Stats map[stat.ID]int
|
||||
Type MonsterType
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
package stat
|
||||
|
||||
type Stat int16
|
||||
type ID int16
|
||||
|
||||
type Data struct {
|
||||
ID ID
|
||||
Value int
|
||||
Layer int
|
||||
}
|
||||
|
||||
const (
|
||||
Strength Stat = iota
|
||||
Strength ID = iota
|
||||
Energy
|
||||
Dexterity
|
||||
Vitality
|
||||
@@ -364,7 +370,7 @@ const (
|
||||
PassiveMagicPierce
|
||||
)
|
||||
|
||||
func (s Stat) String() string {
|
||||
func (s ID) String() string {
|
||||
switch s {
|
||||
case Strength:
|
||||
return "strength"
|
||||
|
||||
Reference in New Issue
Block a user