Оценить:
 Рейтинг: 0

Справочник Жаркова по проектированию и программированию искусственного интеллекта. Том 3: Программирование на Visual C# искусственного интеллекта (продолжение 2)

Год написания книги
2022
<< 1 ... 9 10 11 12 13 14 15 16 17 ... 26 >>
На страницу:
13 из 26
Настройки чтения
Размер шрифта
Высота строк
Поля
dealerHoleCard. FaceUp = true;
mode = GameMode. Push;
return;
}
mode = GameMode.PlayerActive;
}
Font messageFont = new Font(FontFamily.GenericSansSerif, 20,
FontStyle.Regular);
void paintForm (Graphics g)
{
switch (mode)
{
case GameMode. LoadingDisplay:
//We draw all images below the menu:
g. DrawImage (
bankImage, 0, StayToolStripMenuItem. Height);
g. DrawImage (
loadingImage, 0, StayToolStripMenuItem. Height +60);
break;
case GameMode.PlacingBets:
g. DrawImage (bankImage, 0, StayToolStripMenuItem. Height);
Utilities.BigText («Bank: " + pot.PotValue.ToString (),
10, 40, Color. Black,
Color. Yellow, messageFont, g);
Utilities.BigText («Bet: " +
pot.BetValue.ToString (), 10, 80, Color. Black,
Color. Yellow, messageFont, g);
break;
case GameMode.PlayerActive:
dealerHand. DrawHand (g, 10, 30, 80, 25);
playerHand. DrawHand (g, 10, 135, 20, 25);
Utilities.BigText (playerHand. BlackJackScoreHand ().
ToString (), 140, 150, Color. Black,
Color. Yellow, messageFont, g);
break;
case GameMode.PlayerWon:
case GameMode. PocketJack:
dealerHand. DrawHand (g, 10, 30, 20, 25);
playerHand. DrawHand (g, 10, 135, 20, 25);
Utilities.BigText (dealerHand. BlackJackScoreHand ().
ToString (), 140, 45, Color. Black,
Color. Yellow, messageFont, g);
Utilities.BigText (playerHand. BlackJackScoreHand ().
ToString (), 140, 150, Color. Black,
Color. Yellow, messageFont, g);
Utilities.BigText («Вы выиграли!»,
20, 80, Color. Black, Color. Yellow, messageFont, g);
break;
case GameMode.PlayerBust:
dealerHand. DrawHand (g, 10, 30, 80, 25);
playerHand. DrawHand (g, 10, 135, 20, 25);
Utilities.BigText (playerHand. BlackJackScoreHand ().
ToString (), 140, 150, Color. Black,
Color. Yellow, messageFont, g);
Utilities.BigText («Вы перебрали.»,
20, 80, Color. Black, Color.Red, messageFont, g);
break;
case GameMode.DealerActive:
dealerHand. DrawHand (g, 10, 30, 20, 25);
playerHand. DrawHand (g, 10, 135, 20, 25);
Utilities.BigText (dealerHand. BlackJackScoreHand ().
ToString (), 140, 45, Color. Black,
Color. Yellow, messageFont, g);
Utilities.BigText (playerHand. BlackJackScoreHand ().
ToString (), 140, 150, Color. Black,
Color. Yellow, messageFont, g);
break;
case GameMode.DealerWon:
dealerHand. DrawHand (g, 10, 30, 20, 25);
playerHand. DrawHand (g, 10, 135, 20, 25);
Utilities.BigText (dealerHand. BlackJackScoreHand ().
ToString (), 140, 45, Color. Black,
Color. Yellow, messageFont, g);
Utilities.BigText (playerHand. BlackJackScoreHand ().
ToString (), 140, 150, Color. Black,
Color. Yellow, messageFont, g);
Utilities.BigText («Вы потеряли.»,
20, 80, Color. Black, Color.Red, messageFont, g);
break;
case GameMode.DealerBust:
dealerHand. DrawHand (g, 10, 30, 20, 25);
playerHand. DrawHand (g, 10, 135, 20, 25);
Utilities.BigText (dealerHand. BlackJackScoreHand ().
ToString (), 140, 45, Color. Black,
Color. Yellow, messageFont, g);
Utilities.BigText (playerHand. BlackJackScoreHand ().
ToString (), 140, 150, Color. Black,
Color. Yellow, messageFont, g);
Utilities.BigText («Dealer Bust»,
20, 80, Color. Black, Color. Yellow, messageFont, g);
break;
case GameMode. Push:
dealerHand. DrawHand (g, 10, 30, 20, 25);
playerHand. DrawHand (g, 10, 135, 20, 25);
Utilities.BigText (dealerHand. BlackJackScoreHand ().
ToString (), 140, 45, Color. Black,
Color. Yellow, messageFont, g);
Utilities.BigText (playerHand. BlackJackScoreHand ().
ToString (), 140, 150, Color. Black,
Color. Yellow, messageFont, g);
<< 1 ... 9 10 11 12 13 14 15 16 17 ... 26 >>
На страницу:
13 из 26