C# 클래스 Supermarket.ShoppingList

A list of supermarket items and their desired quantites.
파일 보기 프로젝트 열기: Clarksj4/Theme-Supermarket-Tycoon-World 1 사용 예제들

공개 메소드들

메소드 설명
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