当前位置: 首页>>代码示例>>C#>>正文


C# Money.getValue方法代码示例

本文整理汇总了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.");
         }
     }
 }
开发者ID:WaterKH,项目名称:AutismProject,代码行数:33,代码来源:CustomerPayment.cs


注:本文中的Money.getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。