Documentation ¶
Index ¶
- Constants
- type CTXkey
- type Ingredient
- type Inventory
- func (inv *Inventory) GetIngredientByName(ingredientName string) *Ingredient
- func (inv *Inventory) GetStockByingredientName(name string) *Stock
- func (inv *Inventory) Init(ctx context.Context, e *engine.Engine) (errs error)
- func (inv *Inventory) InventoryLoad()
- func (inv *Inventory) InventorySave() error
- func (inv *Inventory) Iter(fun func(s *Stock))
- func (inv *Inventory) Tele() *tele_api.Inventory
- func (inv *Inventory) WithTuning(ctx context.Context, ingredientName string, adj float32) (context.Context, error)
- type Stock
- func (s *Stock) GetSpendRate() float32
- func (s *Stock) Has(v float32) bool
- func (s *Stock) Set(v float32)
- func (s *Stock) SetLevel(level int)
- func (s *Stock) ShowLevel() string
- func (s *Stock) SpendValue(value byte)
- func (s *Stock) String() string
- func (s *Stock) TranslateSpend(arg engine.Arg) float32
- func (s *Stock) Value() float32
- func (s *Stock) Wrap(d engine.Doer) engine.Doer
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 (*Inventory) InventoryLoad ¶ added in v0.220611.0
func (inv *Inventory) InventoryLoad()
store file инвентарь храниться как int32 ( для возможности сохраннения в CMOS) код соответствует позиции в файле
func (*Inventory) InventorySave ¶ added in v0.220611.0
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 (*Stock) SpendValue ¶ added in v0.240430.0
Click to show internal directories.
Click to hide internal directories.