public SplitCommand(BlackJackModule blackjack, PlayerModule playermodule, RPGMessageModule messages, CardImageModule images) { this.blackjack = blackjack; this.playermodule = playermodule; this.messages = messages; this.images = images; }
/// <summary> /// creates a new <see cref="HoldemCommand"/> /// </summary> /// <param name="casino">access to holdem module</param> /// <param name="playermodule">access to player data</param> /// <param name="messagemodule">access to game messages</param> /// <param name="imagemodule">access to card images</param> public HoldemCommand(HoldemModule casino, PlayerModule playermodule, RPGMessageModule messagemodule, CardImageModule imagemodule) { this.casino = casino; this.playermodule = playermodule; this.messagemodule = messagemodule; this.imagemodule = imagemodule; }
public CallCommand(HoldemModule casino, PlayerModule playermodule, RPGMessageModule messagemodule, CardImageModule cardimages) { this.casino = casino; this.playermodule = playermodule; this.messagemodule = messagemodule; this.cardimages = cardimages; }
public void TestCardUrl([ValueSource("Codes")] Tuple <Card, byte> data) { CardImageModule module = new CardImageModule(null); string url = module.GetCardUrl(data.Item1); Match match = Regex.Match(url, "code=(?<code>[0-9]+)$"); Assert.That(match.Success); Assert.AreEqual(data.Item2, byte.Parse(match.Groups["code"].Value)); }
public VideoPokerDrawCommand(VideoPokerModule pokermodule, PlayerModule playermodule, RPGMessageModule messagemodule, CardImageModule imagemodule) { this.pokermodule = pokermodule; this.playermodule = playermodule; this.messagemodule = messagemodule; this.imagemodule = imagemodule; }
public void PlayoutDealer(BlackJackGame game, RPGMessageBuilder messages, PlayerModule playermodule, CardImageModule images) { messages.ShopKeeper().Text(" is drawing his hand to "); int value = 0; do { game.DealerBoard += game.Stack.Pop(); value = Evaluate(game.DealerBoard); }while(value < 17); foreach (Card card in game.DealerBoard) { messages.Image(images.GetCardUrl(card), $"{card} "); } if (value > 21) { messages.Text(" Bust!"); } else { messages.Text($"({value}) "); } int payout = 0; if (value > 21) { foreach (BlackJackBoard board in game.PlayerBoards) { payout = board.Bet * 2; } } else { foreach (BlackJackBoard board in game.PlayerBoards) { int boardvalue = Evaluate(board.Board); if (boardvalue > value) { payout = board.Bet * 2; } else if (boardvalue == value) { payout = board.Bet; } } } if (payout > 0) { messages.Text("Payout is ").Gold(payout); playermodule.UpdateGold(game.PlayerID, payout); } else { messages.ShopKeeper().Text(" laughs at you."); } }