Exemple #1
0
func (f *Fac) AddResource(tran *trans.Transaction) {
	fmt.Println(f.Id(), " getting qty=", tran.Resource().Qty(), "of", f.InCommod)
	err := f.inBuff.Push(tran.Manifest...)
	check(err)
}
Exemple #2
0
func (f *Fac) RemoveResource(tran *trans.Transaction) {
	fmt.Println(f.Id(), " sending qty=", tran.Resource().Qty(), "of", f.OutCommod)
	rs, err := f.outBuff.PopQty(tran.Resource().Qty())
	check(err)
	tran.Manifest = rs
}