本文整理汇总了C#中Money.getValue方法的典型用法代码示例。如果您正苦于以下问题:C# Money.getValue方法的具体用法?C# Money.getValue怎么用?C# Money.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Money
的用法示例。
在下文中一共展示了Money.getValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: generatePriceFromPayments
//GenerateRandomValue()
/*
* Generates a value from our decimal array (payments)
*
* IF our current game state equals the instance of the game "Money Exchanger"
* IF we do not have another transaction (ie a customer) going on AND our index
* is less than the size of our array.
* We create a new instance of Money with the value at our index within payments.
* We then set our price text value to be displayed on screen to the value we
* found at our index within our decimal array (payments). We also set our
* customer's payment equal to the decimal value we get from the function call,
* customerPayment. Finally, we increment the index we are pointing to within
* our decimal array (payments).
*
*/
public void generatePriceFromPayments()
{
if(theGame.currentGameState == (int)Game.GameState.moneyExchanger)
{
if(!onGoingTransaction && indexOfPayments < payments.Length)
{
aMoney = new Money(payments[indexOfPayments]);
displayPrice.text = aMoney.getValue().ToString();
displaycustomerPayment.text = this.customerPayment().ToString();
++indexOfPayments;
onGoingTransaction = true;
}
else if(onGoingTransaction)
{
Debug.Log("Complete the current customer before continuing.");
}
}
}