public static void DeterminSupplyIssue() { if (Array.Exists(moneyAvailable, denominations => denominations == 3 || moneyAvailable[0] == 1)) // 3 * 500kr borders on too many, else too few { ActivityControl.AlertSecurity(); } else { } }
public static void RegisterValidBanknote(int banknoteInsert) { ActivityControl.RespondToCustomerActivity(); if (banknoteInsert == 1000 || banknoteInsert == 500 || banknoteInsert == 100 || banknoteInsert == 50 || banknoteInsert == 20) { TransferAmount(banknoteInsert); AddToMoneyHeld(banknoteInsert); } else { SendMessage("Insertion not recognized as a valid banknote"); ReturnInvalidInsertion(banknoteInsert); } }
public static void RegisterValidCoin(int coinInsert) { ActivityControl.RespondToCustomerActivity(); if (coinInsert == 10 || coinInsert == 5 || coinInsert == 1) { TransferAmount(coinInsert); AddToMoneyHeld(coinInsert); } else { SendMessage("Insertion not recognized as a valid coin"); ReturnInvalidInsertion(coinInsert); } }
public static void RegisterKeyPush(int keyPush) { latestKeyPush = newKeyPush; newKeyPush = keyPush; ActivityControl.RespondToCustomerActivity(); latestKeyPush = keyPush; if (keyPush == 0) { ActivityControl.EndSession(); } else { ActivityControl.BuyProduct(newKeyPush, latestKeyPush); } }
public static void DetailTheExchange(int keyPush, int preceedingKeyPush) { if (debtToCustomer > ProductStock.ShowProductInfo(keyPush).ProductPrice) { if (keyPush == preceedingKeyPush && Display.RevealCurrentMessage().Contains("to confirm")) { ProductStock.SendProduct(keyPush); debtToCustomer -= ProductStock.ShowProductInfo(keyPush).ProductPrice; } else { ActivityControl.ConcatenateCurrentMessage($"Push {keyPush} to confirm buy"); } } else { ActivityControl.ConcatenateCurrentMessage($"You miss by {debtToCustomer - ProductStock.ShowProductInfo(keyPush - 1).ProductPrice}kr"); } }
protected static void SendMessage(string message) { ActivityControl.ConcatenateCurrentMessage(message); }