C# 클래스 Supermarket.Supermarket

Supermarket script. Contains product catalogue and directory information, manages shelves, and money.
상속: UnityEngine.MonoBehaviour, IEmptyShelfListener
파일 보기 프로젝트 열기: Clarksj4/Theme-Supermarket-Tycoon-World 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
ExitIcon UnityEngine.GameObject
IdleIcon UnityEngine.GameObject
WanderIcon UnityEngine.GameObject

공개 메소드들

메소드 설명
AddListener ( IWalletListener listener ) : void
AddToDirectory ( string product, Shelf shelf ) : void

Adds the given shelf to the supermarket product directory. The directory shows which shelves stock which products

Awake ( ) : void
ClosestExit ( Vector3 position ) : GameObject

Gets the closest exit zone to the given position.

ClosestShelf ( Vector3 position, string product ) : Shelf

Gets the closest shelf to the given pposition that stocks the given product. Returns null if no shelf stocks the given product

Deposit ( float amount ) : void

Adds the given amount of money to the supermarkets cash pool

NextEmptyShelf ( ) : Shelf
NotifyDeposit ( float amountDeposited ) : void
NotifyShelfEmpty ( Shelf shelf, string product ) : void

Interface method. Called when a shelf runs out of the given product.

NotifyWithdrawal ( float amountWithdrawn ) : void
OccupiedCheckout ( ) : Checkout
RandomCheckout ( ) : Checkout

Selects a random checkout in this supermarket.

RandomExit ( ) : GameObject

Gets a random exit zone.

RandomPosition ( ) : Vector3

Gets a random position within the supermarket that is on the supermarket navmesh

RandomProduct ( ) : Product

Gets a random product with a random quantity from the supermarket catalogue

RemoveListener ( IWalletListener listener ) : void
Withdraw ( float amount ) : void

Withdraws the given amount of money from the supermarket's cash pool

메소드 상세

AddListener() 공개 메소드

public AddListener ( IWalletListener listener ) : void
listener IWalletListener
리턴 void

AddToDirectory() 공개 메소드

Adds the given shelf to the supermarket product directory. The directory shows which shelves stock which products
public AddToDirectory ( string product, Shelf shelf ) : void
product string The product key to add to the directory
shelf Shelf The shelf that stocks the product
리턴 void

Awake() 공개 메소드

public Awake ( ) : void
리턴 void

ClosestExit() 공개 메소드

Gets the closest exit zone to the given position.
public ClosestExit ( Vector3 position ) : GameObject
position UnityEngine.Vector3 The position to check against to find the closest exit zone
리턴 UnityEngine.GameObject

ClosestShelf() 공개 메소드

Gets the closest shelf to the given pposition that stocks the given product. Returns null if no shelf stocks the given product
public ClosestShelf ( Vector3 position, string product ) : Shelf
position UnityEngine.Vector3 The position to check against when finding the closest shelf
product string The product that the shelf must stock in order to be considered for closeness
리턴 Shelf

Deposit() 공개 메소드

Adds the given amount of money to the supermarkets cash pool
public Deposit ( float amount ) : void
amount float The amount of money to add to this supermarket's cash pool
리턴 void

NextEmptyShelf() 공개 메소드

public NextEmptyShelf ( ) : Shelf
리턴 Shelf

NotifyDeposit() 공개 메소드

public NotifyDeposit ( float amountDeposited ) : void
amountDeposited float
리턴 void

NotifyShelfEmpty() 공개 메소드

Interface method. Called when a shelf runs out of the given product.
public NotifyShelfEmpty ( Shelf shelf, string product ) : void
shelf Shelf The shelf that has run out of stock of a product
product string The product that the shelf has run out of the given product
리턴 void

NotifyWithdrawal() 공개 메소드

public NotifyWithdrawal ( float amountWithdrawn ) : void
amountWithdrawn float
리턴 void

OccupiedCheckout() 공개 메소드

public OccupiedCheckout ( ) : Checkout
리턴 Checkout

RandomCheckout() 공개 메소드

Selects a random checkout in this supermarket.
public RandomCheckout ( ) : Checkout
리턴 Checkout

RandomExit() 공개 메소드

Gets a random exit zone.
public RandomExit ( ) : GameObject
리턴 UnityEngine.GameObject

RandomPosition() 공개 메소드

Gets a random position within the supermarket that is on the supermarket navmesh
public RandomPosition ( ) : Vector3
리턴 UnityEngine.Vector3

RandomProduct() 공개 메소드

Gets a random product with a random quantity from the supermarket catalogue
public RandomProduct ( ) : Product
리턴 Product

RemoveListener() 공개 메소드

public RemoveListener ( IWalletListener listener ) : void
listener IWalletListener
리턴 void

Withdraw() 공개 메소드

Withdraws the given amount of money from the supermarket's cash pool
public Withdraw ( float amount ) : void
amount float The amount of money to withdraw
리턴 void

프로퍼티 상세

ExitIcon 공개적으로 프로퍼티

public GameObject,UnityEngine ExitIcon
리턴 UnityEngine.GameObject

IdleIcon 공개적으로 프로퍼티

public GameObject,UnityEngine IdleIcon
리턴 UnityEngine.GameObject

WanderIcon 공개적으로 프로퍼티

public GameObject,UnityEngine WanderIcon
리턴 UnityEngine.GameObject