1
0
Fork 0

[golang] finished implementing procument contracts

This commit is contained in:
Julien Dessaux 2025-02-21 00:58:45 +01:00
parent 40c4a8df15
commit e887213aff
Signed by: adyxax
GPG key ID: F92E51B86E07177E
15 changed files with 252 additions and 56 deletions

View file

@ -30,6 +30,9 @@ func (c *Client) Accept(contract *model.Contract) error {
}
func (c *Client) Deliver(contract *model.Contract, ship *model.Ship) error {
if err := c.Dock(ship); err != nil {
return fmt.Errorf("failed to dock: %w", err)
}
deliver := contract.Terms.Deliver[0]
var units int
for _, cargoItem := range ship.Cargo.Inventory {