C# Class Supermarket.ShoppingList

A list of supermarket items and their desired quantites.
Afficher le fichier Open project: Clarksj4/Theme-Supermarket-Tycoon-World Class Usage Examples

Méthodes publiques

Méthode Description
Add ( string product, int quota ) : void

// Adds the given product to the shopping list or increases its quota if already present

CheckOff ( int amount ) : bool

Marks the given amount as obtained for the current item of interest on this shopping list.

Next ( ) : bool

Sets the current item of interest to be the next available item in the list (cyclical). Returns false if all items have had their quota reached or have been marked as 'Pass'.

ShoppingList ( ) : System.Collections.Specialized

Method Details

Add() public méthode

// Adds the given product to the shopping list or increases its quota if already present
public Add ( string product, int quota ) : void
product string The product to add to the shopping list
quota int The required amount of product
Résultat void

CheckOff() public méthode

Marks the given amount as obtained for the current item of interest on this shopping list.
public CheckOff ( int amount ) : bool
amount int The amount to mark as obtained
Résultat bool

Next() public méthode

Sets the current item of interest to be the next available item in the list (cyclical). Returns false if all items have had their quota reached or have been marked as 'Pass'.
public Next ( ) : bool
Résultat bool

ShoppingList() public méthode

public ShoppingList ( ) : System.Collections.Specialized
Résultat System.Collections.Specialized