C# Класс Supermarket.ShoppingList

A list of supermarket items and their desired quantites.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Описание методов

Add() публичный Метод

// 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
Результат void

CheckOff() публичный Метод

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
Результат bool

Next() публичный Метод

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
Результат bool

ShoppingList() публичный Метод

public ShoppingList ( ) : System.Collections.Specialized
Результат System.Collections.Specialized