pub struct Village {
pub name: String,
shops: Vec<VisitorShop>,
}
Expand description
Represents a collection of shops that can be visited.
Fields§
§name: String
Name of this village.
shops: Vec<VisitorShop>
List of shops in this village.
Implementations§
source§impl Village
impl Village
sourcepub fn new() -> Village
pub fn new() -> Village
Constructor
Returns
Returns a new instance of the Village struct. Call load() to load the particulars of this instance.
sourcepub fn load(&mut self)
pub fn load(&mut self)
Set up the specified Village object with all the shops that can be visited.
sourcepub fn visit(&mut self, order: &mut OrderVisitor)
pub fn visit(&mut self, order: &mut OrderVisitor)
Visit all shops in the given Village object to find the ingredients specified in the OrderVisitor object. Can set off a nested chain of calls.
Parameters
-
order
An OrderVisitor object that contains a list of items to order and a list of items received after the visit is complete.