func NewAgent(name string, power int, auction *Auction) *Agent { return &Agent{ Life: autonomous.NewLife(), Stopper: make(autonomous.Stopper), auction: auction, stream: make(Consumer), bettingPower: power, identifier: data.ID(name), } }
func (db *DB) ParseID(s string) (data.ID, error) { oid, err := mongo.ParseObjectID(s) return data.ID(oid.Hex()), err }
func (db *DB) NewID() data.ID { return data.ID(mongo.NewObjectID().Hex()) }