C# Class Supermarket.Supermarket

Supermarket script. Contains product catalogue and directory information, manages shelves, and money.
Inheritance: UnityEngine.MonoBehaviour, IEmptyShelfListener
Afficher le fichier Open project: Clarksj4/Theme-Supermarket-Tycoon-World Class Usage Examples

Méthodes publiques

Свойство Type Description
ExitIcon UnityEngine.GameObject
IdleIcon UnityEngine.GameObject
WanderIcon UnityEngine.GameObject

Méthodes publiques

Méthode Description
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

Method Details

AddListener() public méthode

public AddListener ( IWalletListener listener ) : void
listener IWalletListener
Résultat void

AddToDirectory() public méthode

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
Résultat void

Awake() public méthode

public Awake ( ) : void
Résultat void

ClosestExit() public méthode

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
Résultat UnityEngine.GameObject

ClosestShelf() public méthode

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
Résultat Shelf

Deposit() public méthode

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
Résultat void

NextEmptyShelf() public méthode

public NextEmptyShelf ( ) : Shelf
Résultat Shelf

NotifyDeposit() public méthode

public NotifyDeposit ( float amountDeposited ) : void
amountDeposited float
Résultat void

NotifyShelfEmpty() public méthode

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
Résultat void

NotifyWithdrawal() public méthode

public NotifyWithdrawal ( float amountWithdrawn ) : void
amountWithdrawn float
Résultat void

OccupiedCheckout() public méthode

public OccupiedCheckout ( ) : Checkout
Résultat Checkout

RandomCheckout() public méthode

Selects a random checkout in this supermarket.
public RandomCheckout ( ) : Checkout
Résultat Checkout

RandomExit() public méthode

Gets a random exit zone.
public RandomExit ( ) : GameObject
Résultat UnityEngine.GameObject

RandomPosition() public méthode

Gets a random position within the supermarket that is on the supermarket navmesh
public RandomPosition ( ) : Vector3
Résultat UnityEngine.Vector3

RandomProduct() public méthode

Gets a random product with a random quantity from the supermarket catalogue
public RandomProduct ( ) : Product
Résultat Product

RemoveListener() public méthode

public RemoveListener ( IWalletListener listener ) : void
listener IWalletListener
Résultat void

Withdraw() public méthode

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
Résultat void

Property Details

ExitIcon public_oe property

public GameObject,UnityEngine ExitIcon
Résultat UnityEngine.GameObject

IdleIcon public_oe property

public GameObject,UnityEngine IdleIcon
Résultat UnityEngine.GameObject

WanderIcon public_oe property

public GameObject,UnityEngine WanderIcon
Résultat UnityEngine.GameObject