inventory

package
v0.250115.3 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: CC0-1.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const RegexLevels = `([0-9]*[.,]?[0-9]+)\(([0-9]*[.,]?[0-9]+)\)`

Variables

This section is empty.

Functions

This section is empty.

Types

type CTXkey added in v0.250106.0

type CTXkey string

структура для контекста should not use built-in type string as key for value; define your own type to avoid collisions (SA1029)

type Ingredient added in v0.250104.0

type Ingredient struct {
	Name      string  `hcl:"name,label"`
	Min       int     `hcl:"min,optional"`
	SpendRate float32 `hcl:"spend_rate,optional"`
	Level     string  `hcl:"level,optional"`
	TuneKey   string  `hcl:"tuning_key,optional"`
	Cost      float64 `hcl:"cost,optional"`
	// contains filtered or unexported fields
}

if the minimum ingredient is not specified (equal to zero), then the consumption check is disabled если минимум ингридиента не указан (равен нулю), тогда проверка расхода выключена

type Inventory

type Inventory struct {
	File           string       `hcl:"stock_file,optional"`
	Stocks         []Stock      `hcl:"stock,block"`
	Ingredient     []Ingredient `hcl:"ingredient,block"`
	XXX_Stocks     map[string]Stock
	XXX_Ingredient map[string]Ingredient
	// contains filtered or unexported fields
}

func (*Inventory) GetIngredientByName added in v0.250104.0

func (inv *Inventory) GetIngredientByName(ingredientName string) *Ingredient

func (*Inventory) GetStockByingredientName added in v0.250106.0

func (inv *Inventory) GetStockByingredientName(name string) *Stock

func (*Inventory) Init

func (inv *Inventory) Init(ctx context.Context, e *engine.Engine) (errs error)

func (*Inventory) InventoryLoad added in v0.220611.0

func (inv *Inventory) InventoryLoad()

store file инвентарь храниться как int32 ( для возможности сохраннения в CMOS) код соответствует позиции в файле

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) Tele

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

func (*Inventory) WithTuning

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

type Stock

type Stock struct {
	Log            *log2.Log
	ErrorSend      bool
	Label          string `hcl:",label"`
	Code           int    `hcl:"code,optional"`
	XXX_Ingredient string `hcl:"ingredient"`
	RegisterAdd    string `hcl:"register_add,optional"`
	Ingredient     *Ingredient
	// contains filtered or unexported fields
}

func (*Stock) GetSpendRate added in v0.240430.0

func (s *Stock) GetSpendRate() float32

func (*Stock) Has

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

func (*Stock) Set

func (s *Stock) Set(v float32)

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) SpendValue added in v0.240430.0

func (s *Stock) SpendValue(value byte)

func (*Stock) String

func (s *Stock) String() string

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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