8#ifndef __VISITOR_SHOP_H__
9#define __VISITOR_SHOP_H__
11#include "helpers/mapofstrings.h"
bool Shop_PickupOrder(Visitor_Shop *shop, ConstStringList *items, ConstStringList *itemsToBePickedUp)
Pick up the items sold by this shop (assumes the items were ordered already). Basically,...
void Shop_Destroy(Visitor_Shop *shop)
Destroy an instance of the Visitor_Shop structure, freeing up any memory that may have been allocated...
PlaceOrderReponse
Represents the possible responses from the Shop_PlaceOrder() function.
@ PlaceOrderResponse_OrderIgnored
Order was ignored.
@ PlaceOrderResponse_Error
There was an error placing the order, likely an out of memory condition.
@ PlaceOrderResponse_OrderAccepted
Order was accepted.
Visitor_Shop * Shop_Create(const char *name, const char *address, struct Village *village)
Creates a new instance of a Visitor_Shop structure, and initializes it with the given name,...
PlaceOrderReponse Shop_PlaceOrder(Visitor_Shop *shop, ConstStringList *itemsToOrder)
Visit the specified Visitor_Shop object to try to place an order as described in the OrderVisitor obj...
Declaration of the MapOfInt structure and supporting functions for managing a map of integers keyed b...
Represents a list of pointers to zero-terminated strings that are to remain constant and never delete...
Represents a list of MapOfIntEntry objects that maps a string to an integer value....
Represents a list of structures that map strings to ConstStringList objects.
Represents a visitor used for ordering items from various shops. The user starts with an instance of ...
Represents a collection of shops that can be visited.
Represents a shop in the village that can be visited.
const char * Name
Name of shop. Borrowed pointer.
const char * Address
Address of shop. Borrowed pointer.
MapOfInt Inventory
Maps ingredient to number of that ingredient in the shop.
struct Village * Village
Village this shop is in. Borrowed pointer.
MapOfStrings IngredientsForItems
Maps ingredient to list of items need for ingredient.