inventory

package
v0.240209.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: CC0-1.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inventory

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

func (*Inventory) Get

func (inv *Inventory) Get(name string) (*Stock, error)

func (*Inventory) Init

func (inv *Inventory) Init(ctx context.Context, c *engine_config.Inventory, engine *engine.Engine, root string) error

func (*Inventory) InventoryLoad added in v0.220611.0

func (inv *Inventory) InventoryLoad()

func (*Inventory) InventorySave added in v0.220611.0

func (inv *Inventory) InventorySave() error

func (*Inventory) Iter

func (inv *Inventory) Iter(fun func(s *Stock))

func (*Inventory) SetTele

func (inv *Inventory) SetTele(src *tele_api.Inventory) (*tele_api.Inventory, error)

func (*Inventory) Tele

func (inv *Inventory) Tele() *tele_api.Inventory

func (*Inventory) WithTuning

func (inv *Inventory) WithTuning(ctx context.Context, stockName string, adj float32) (context.Context, error)

type Stock

type Stock struct {
	Code uint32
	Name string

	TeleLow bool
	// contains filtered or unexported fields
}

func NewStock

func NewStock(c engine_config.Stock, e *engine.Engine) (*Stock, error)

func (*Stock) Enabled

func (s *Stock) Enabled() bool

func (s *Stock) Enabled() bool { return atomic.LoadUint32(&s.enabled) == 1 }

func (*Stock) Has

func (s *Stock) Has(v float32) bool

func (*Stock) Set

func (s *Stock) Set(v float32)

func (s *Stock) Set(new float32) { s.value.Store(new) }

func (*Stock) SetLevel added in v0.230101.1

func (s *Stock) SetLevel(level int)

func (*Stock) ShowLevel added in v0.230101.1

func (s *Stock) ShowLevel() string

func (*Stock) String

func (s *Stock) String() string

func (*Stock) TranslateHw

func (s *Stock) TranslateHw(arg engine.Arg) float32

func (*Stock) TranslateSpend

func (s *Stock) TranslateSpend(arg engine.Arg) float32

func (*Stock) Value

func (s *Stock) Value() float32

func (*Stock) Wrap

func (s *Stock) Wrap(d engine.Doer) engine.Doer

Jump to

Keyboard shortcuts

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