public VideoPokerPayout GetPayout(PayTable paytable, Card[] hand, int creditsBet) { var handValue = _handAnalyzer.GetHandValue(hand); var payLine = paytable.PayLines .Where(pl => pl.MinValue <= handValue && pl.MaxValue >= handValue) .OrderByDescending(pl => pl.Payout) .FirstOrDefault(); if (payLine == null) { return new VideoPokerPayout { Payout = 0, PayLine = null } } ; var result = new VideoPokerPayout { PayLine = payLine }; if (creditsBet >= 5) { result.Payout = (int)(creditsBet * payLine.Payout * payLine.MaxBetMultiplier); } else { result.Payout = creditsBet * payLine.Payout; } return(result); } }
private void btnUpdatePay_Click(object sender, EventArgs e) { if (isDigit(txtMoneyPay.Text) == true) { if (txtDescribePay.Text.Trim() != "") { PayTable pay = new PayTable(); pay.Id = Int32.Parse(txtIdPay.Text); pay.InputDate = DateTime.Parse(txtInputDatePay.Text); pay.Describe = txtDescribePay.Text; pay.IdPayer = ReceiveDAO.Instance.GetIdReceiverByName(cbbPayerPay.Text); pay.IdReceiver = ReceiveDAO.Instance.GetIdPayerByName(cbbReceiverPay.Text); pay.Money = float.Parse(txtMoneyPay.Text); if (PayDAO.Instance.UpdatePay(pay) == true) { MessageBox.Show("Update success!"); LoadPay(); } else { MessageBox.Show("Update fail!"); } } else { MessageBox.Show("Lí Do Chi Tiền Không Được Để Trống!"); } } else { MessageBox.Show("Số Tiền Chi Phải Là Số!"); } }
public HandResult ResolveHand(Card[] heldCards, int bet, PayTable payTable) { _deck.Shuffle(); var newCards = _deck.Peek(5 - heldCards.Length); var finalHand = newCards.Concat(heldCards).ToArray(); var payout = _payoutCalculator.GetPayout(payTable, finalHand, bet); if (payout.PayLine == null) { return new HandResult { PayLineHit = "None", Payout = 0, Hand = finalHand } } ; else { return new HandResult { PayLineHit = payout.PayLine.Name, Payout = payout.Payout, Hand = finalHand } }; } }
public bool UpdatePay(PayTable pay) { int data = 0; string query = string.Format("USP_UpdatePay @id = {0}, @inputDate = N'{1}', @idReceiver = {2}, @idPayer = {3}, @describe = N'{4}', @money = {5}", pay.Id, pay.InputDate, pay.IdReceiver, pay.IdPayer, pay.Describe, pay.Money); data = DataProvider.Instance.ExecuteNonQuery(query); return(data > 0); }
void Start() { infoPanel = GameObject.Find("Canvas").transform.Find("InfoPanel"); infoPanel.gameObject.SetActive(true); payTable = infoPanel.GetComponentInChildren <PayTable>(); InitPayTable(); ClosePayTable(); InitLabels(); InitArena(); isInput = true; }
public DDBP9898PayoutTests() { var handAnalyzer = new HandAnalyzer(new IHandChecker[] { new HighCardChecker(), new PairChecker(), new TwoPairChecker(), new ThreeOfAKindChecker(), new StraitChecker(), new FlushChecker(), new FullHouseChecker(), new FourOfAKindChecker(), new StraitFlushChecker() }); _payoutCalc = new VideoPokerPayoutCalculator(handAnalyzer); _payTable = StandardPayTables.DDB_9898; }
/// <summary> /// 返回受影响的行数 /// </summary> /// <param name="Billdate"></param> /// <returns></returns> public async Task <int> GetFXStmtLines(string[] Billdate) { var count = 0; PayTable p = null; for (var i = 0; i < Billdate.Length; i++) { var data = CommServices.GetOrderTime(Billdate[i]); if (data != null) { foreach (var item in data) { var model = await _fXStmtLineServices.GetModelAsync(obj => obj.bankTrxnNo == item.bankTrxnNo); if (model != null) { continue; } p = new PayTable { bankTrxnNo = item.bankTrxnNo, orderNo = item.orderNo, trxNo = item.trxNo, payWayCode = item.payWayCode, payWayName = item.payWayName }; p.orderNo = item.orderNo; p.orderTime = item.orderTime; p.orderDate = item.orderDate; p.orderAmount = item.orderAmount; p.productName = item.productName; p.isRefund = item.isRefund; p.refundAmount = item.refundAmount; await _payTableRepository.Add(p); count++; } } } return(count); }
public GameStatePayload ReDeal() { if (gameState != GameState.FirstDeal) { return(new GameStatePayload(gameState)); } ReplaceCards(); var winningCombination = PayTable.CheckForWin(hand.Select(c => c.Card).ToList()); if (winningCombination == null) { gameState = GameState.Lost; return(new GameStatePayload(gameState)); } gameState = GameState.Won; var winAmount = winningCombination.GetPayoutMultiplier(coins) * bet; Player.Money += winAmount; return(new GameStatePayload(gameState, winningCombination, winAmount)); }
public void GameSelect(PayTable paytable) { _payTable = paytable; }