diablo2stats

package
v0.0.0-...-7f92c57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package diablo2stats is the Diablo 2 stats implementation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Diablo2StatList

type Diablo2StatList struct {
	// contains filtered or unexported fields
}

Diablo2StatList is a diablo 2 implementation of a stat list

func (*Diablo2StatList) AppendStatList

func (sl *Diablo2StatList) AppendStatList(other d2stats.StatList) d2stats.StatList

AppendStatList adds the stats from the other stat list to this stat list

func (*Diablo2StatList) Clone

func (sl *Diablo2StatList) Clone() d2stats.StatList

Clone returns a deep copy of the stat list

func (*Diablo2StatList) Index

func (sl *Diablo2StatList) Index(idx int) d2stats.Stat

Index returns a stat given with the given index

func (*Diablo2StatList) Pop

func (sl *Diablo2StatList) Pop() d2stats.Stat

Pop removes the last stat from the stat list

func (*Diablo2StatList) Push

func (sl *Diablo2StatList) Push(stat d2stats.Stat) d2stats.StatList

Push adds a stat at the end of the stat list

func (*Diablo2StatList) ReduceStats

func (sl *Diablo2StatList) ReduceStats() d2stats.StatList

ReduceStats combines like stats (does not alter this stat list, returns clone)

func (*Diablo2StatList) RemoveStatAtIndex

func (sl *Diablo2StatList) RemoveStatAtIndex(idx int) d2stats.Stat

RemoveStatAtIndex removes the stat from the stat list, returns the stat

func (*Diablo2StatList) SetStats

func (sl *Diablo2StatList) SetStats(stats []d2stats.Stat) d2stats.StatList

SetStats sets the stats, given a slice of stats

func (*Diablo2StatList) Stats

func (sl *Diablo2StatList) Stats() []d2stats.Stat

Stats returns a slice of stats

type Diablo2StatValue

type Diablo2StatValue struct {
	// contains filtered or unexported fields
}

Diablo2StatValue is a diablo 2 implementation of a stat value

func (Diablo2StatValue) Clone

func (sv Diablo2StatValue) Clone() d2stats.StatValue

Clone returns a deep copy of the stat value

func (*Diablo2StatValue) CombineType

func (sv *Diablo2StatValue) CombineType() d2stats.ValueCombineType

CombineType returns the stat value combination type

func (*Diablo2StatValue) Float

func (sv *Diablo2StatValue) Float() float64

Float returns a float64 version of the value

func (*Diablo2StatValue) Int

func (sv *Diablo2StatValue) Int() int

Int returns the integer version of the stat value

func (*Diablo2StatValue) NumberType

func (sv *Diablo2StatValue) NumberType() d2stats.StatNumberType

NumberType returns the stat value type

func (*Diablo2StatValue) SetFloat

func (sv *Diablo2StatValue) SetFloat(f float64) d2stats.StatValue

SetFloat sets the stat value using a float64

func (*Diablo2StatValue) SetInt

func (sv *Diablo2StatValue) SetInt(i int) d2stats.StatValue

SetInt sets the stat value using an int

func (*Diablo2StatValue) SetStringer

func (sv *Diablo2StatValue) SetStringer(f func(d2stats.StatValue) string) d2stats.StatValue

SetStringer sets the string evaluation function

func (*Diablo2StatValue) String

func (sv *Diablo2StatValue) String() string

String returns a string version of the value

func (*Diablo2StatValue) Stringer

func (sv *Diablo2StatValue) Stringer() func(d2stats.StatValue) string

Stringer returns the string evaluation function

type StatFactory

type StatFactory struct {
	// contains filtered or unexported fields
}

StatFactory is responsible for creating stats

func NewStatFactory

func NewStatFactory(asset *d2asset.AssetManager) (*StatFactory, error)

NewStatFactory creates a new stat factory instance

func (*StatFactory) NewStat

func (f *StatFactory) NewStat(key string, values ...float64) d2stats.Stat

NewStat creates a stat instance with the given record and values

func (*StatFactory) NewStatList

func (f *StatFactory) NewStatList(stats ...d2stats.Stat) d2stats.StatList

NewStatList creates a stat list

func (*StatFactory) NewValue

NewValue creates a stat value of the given type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL