private void DrawPlayerOptions(int moneyToCall) { var col = 2; ConsoleConfig.WriteOnConsole(22, col, "Select action: ["); col += 16; ConsoleConfig.WriteOnConsole(22, col, "C", ConsoleColor.Yellow); col++; ConsoleConfig.WriteOnConsole(22, col, "]heck/["); col += 7; ConsoleConfig.WriteOnConsole(22, col, "C", ConsoleColor.Yellow); col++; var callString = moneyToCall <= 0 ? "]all, [" : "]all(" + moneyToCall + "), ["; ConsoleConfig.WriteOnConsole(22, col, callString); col += callString.Length; ConsoleConfig.WriteOnConsole(22, col, "R", ConsoleColor.Yellow); col++; ConsoleConfig.WriteOnConsole(22, col, "]aise, ["); col += 8; ConsoleConfig.WriteOnConsole(22, col, "F", ConsoleColor.Yellow); col++; ConsoleConfig.WriteOnConsole(22, col, "]old, ["); col += 7; ConsoleConfig.WriteOnConsole(22, col, "A", ConsoleColor.Yellow); col++; ConsoleConfig.WriteOnConsole(22, col, "]ll-in"); }
public void DrawGameBoard() { ConsoleConfig.WriteOnConsole(10, 0, "├──────╯", ConsoleColor.Green); ConsoleConfig.WriteOnConsole(9, 7, "│", ConsoleColor.Green); ConsoleConfig.WriteOnConsole(8, 7, "┬", ConsoleColor.Green); ConsoleConfig.DrawBox(25, 16, 13, 4, ConsoleColor.Green, "─│─│╭╮┴┴"); ConsoleConfig.DrawBox(17, 11, 28, 4, ConsoleColor.Green, "─│─│╭╮╯╰"); }
public void ClearMsg() { ConsoleConfig.WriteOnConsole(21, 0, new string(' ', width), ConsoleColor.White); ConsoleConfig.WriteOnConsole(22, 0, new string(' ', width), ConsoleColor.White); ConsoleConfig.WriteOnConsole(23, 0, new string(' ', width), ConsoleColor.White); ConsoleConfig.WriteOnConsole(25, 1, new string(' ', width - 2), ConsoleColor.White); }
private void DrawSingleCard(int row, int col, Card card) { var cardColor = this.GetCardColor(card); ConsoleConfig.WriteOnConsole(row, col, card.ToCard() + " ", cardColor, ConsoleColor.White); ConsoleConfig.WriteOnConsole(row + 1, col, " ", cardColor, ConsoleColor.White); ConsoleConfig.WriteOnConsole(row + 2, col, " " + card.ToCard(), cardColor, ConsoleColor.White); }
public PlayerUI(IPlayer player, int row, int width, int commonRow) : base(player) { this.row = row; this.width = width; this.commonRow = commonRow; ConsoleConfig.WriteOnConsole(6, 1, "Name: " + player.Name); }
public override void StartRound(IStartRoundContext context) { this.BoardCards = context.BoardCards; this.UpdateCommonRow(context.CurrentPot); ConsoleConfig.WriteOnConsole(this.row + 1, this.width / 2 - 5, context.RoundType + " "); base.StartRound(context); }
private void PrintIncomingMessage(PacketHeader header, Connection connection, string message) { consoleInterface.ClearMsg(); if (message == "Your are Connected to Powker! Wait Another Player...") { ConsoleConfig.WriteOnConsole(6, 55, "Connected"); } consoleInterface.SetMsg(message.ToString()); }
private void UpdateCommonRow(int pot) { this.DrawCommunityCards(); var potAsString = "Pot: " + pot; ConsoleConfig.WriteOnConsole(this.commonRow, this.width - 13, new string(' ', 12)); ConsoleConfig.WriteOnConsole(this.commonRow, this.width - potAsString.Length - 2, potAsString); }
public static void DrawBox(int x, int y, int w, int h, ConsoleColor color, string border) { ConsoleConfig.WriteOnConsole(y, x, new string(border[0], w), color); ConsoleConfig.WriteOnConsole(y + h, x, new string(border[2], w), color); ConsoleConfig.WriteOnConsole(y, x, new string(border[4], 1), color); ConsoleConfig.WriteOnConsole(y, x + w - 1, new string(border[5], 1), color); ConsoleConfig.WriteOnConsole(y + h, x, new string(border[7], 1), color); ConsoleConfig.WriteOnConsole(y + h, x + w - 1, new string(border[6], 1), color); for (var i = 1; i < h; i++) { ConsoleConfig.WriteOnConsole(y + i, x, new string(border[3], 1), color); ConsoleConfig.WriteOnConsole(y + i, x + w - 1, new string(border[1], 1), color); } }
public override void StartHand(IStartHandContext context) { this.UpdateCommonRow(0); var dealerSymbol = context.FirstPlayerName == this.Player.Name ? "Dealer" : " "; ConsoleConfig.WriteOnConsole(this.row + 1, 1, dealerSymbol, ConsoleColor.Green); ConsoleConfig.WriteOnConsole(this.row + 11, 2, "Money: " + context.MoneyLeft.ToString()); this.DrawSingleCard(this.row + 9, width / 2 - 6, context.FirstCard); this.DrawSingleCard(this.row + 9, width / 2 - 1, context.SecondCard); DrawSingleHideCard(this.row + 4, width / 2 - 4); DrawSingleHideCard(this.row + 4, width / 2 - 9); DrawSingleHideCard(this.row + 4, width / 2 + 1); DrawSingleHideCard(this.row + 4, width / 2 - 14); DrawSingleHideCard(this.row + 4, width / 2 + 6); DrawSingleHideCard(this.row + 4, width / 2 + 27); DrawSingleHideCard(this.row + 4, width / 2 + 22); base.StartHand(context); }
public override PlayerAction GetTurn(ITurnContext context) { this.UpdateCommonRow(context.CurrentPot); ConsoleConfig.WriteOnConsole(this.row + 11, 2, new string(' ', 20)); ConsoleConfig.WriteOnConsole(this.row + 11, 2, "Money: " + context.MoneyLeft.ToString()); var action = base.GetTurn(context); var lastAction = (PlayerActionType)action.Type + (action.Type == (int)PlayerActionType.Fold ? string.Empty : "(" + (action.Money + ((context.MoneyToCall < 0) ? 0 : context.MoneyToCall) + ")")); ConsoleConfig.WriteOnConsole(this.row + 11, this.width - 26, new string(' ', 25)); ConsoleConfig.WriteOnConsole(this.row + 11, this.width - 26, "Last act: " + lastAction); var moneyAfterAction = action.Type == (int)PlayerActionType.Fold ? context.MoneyLeft : context.MoneyLeft - action.Money - context.MoneyToCall; ConsoleConfig.WriteOnConsole(this.row + 11, 2, new string(' ', 20)); ConsoleConfig.WriteOnConsole(this.row + 11, 2, "Money: " + context.MoneyLeft.ToString()); return(action); }
public void SetInput() { ConsoleConfig.WriteOnConsole(25, 1, new string(' ', width - 2), ConsoleColor.White); Console.SetCursorPosition(1, 25); }
private void DrawTitleBox() { ConsoleConfig.DrawBox(0, 0, this.width, 4, ConsoleColor.Green, "═║═║╔╗╝╚"); ConsoleConfig.WriteOnConsole(2, width / 2 - ProgramName.Length / 2 - 1, ProgramName, ConsoleColor.Green); }
public void SetMsg(string msg) { ConsoleConfig.WriteOnConsole(21, 1, msg, ConsoleColor.White); }
private void DrawSingleHideCard(int row, int col) { ConsoleConfig.WriteOnConsole(row, col, "? ", ConsoleColor.Gray, ConsoleColor.DarkGray); ConsoleConfig.WriteOnConsole(row + 1, col, " ", ConsoleColor.Gray, ConsoleColor.DarkGray); ConsoleConfig.WriteOnConsole(row + 2, col, " ?", ConsoleColor.Gray, ConsoleColor.DarkGray); }