Справочник Жаркова по проектированию и программированию искусственного интеллекта. Том 3: Программирование на Visual C# искусственного интеллекта (продолжение 2). Валерий Алексеевич Жарков
Чтение книги онлайн.
Читать онлайн книгу Справочник Жаркова по проектированию и программированию искусственного интеллекта. Том 3: Программирование на Visual C# искусственного интеллекта (продолжение 2) - Валерий Алексеевич Жарков страница 15
StayToolStripMenuItem. Text = «Take a card to yourself»;
StayToolStripMenuItem. Enabled = true;
MenuToolStripMenuItem. Text = «Menu»;
MenuToolStripMenuItem. Enabled = true;
//Disturbing noise of the support groups
//surrounding the player:
//not single, but continuous Looping;
Assembly a = Assembly.GetExecutingAssembly ();
Stream s =
a.GetManifestResourceStream (
«PocketJack. pj_bg_noise. wav»);
SoundPlayer player = new SoundPlayer (s);
player.PlayLooping ();
break;
case GameMode.PlayerWon:
BetMinusToolStripMenuItem1.Enabled = false;
BetPlusToolStripMenuItem. Enabled = false;
HitMeToolStripMenuItem. Enabled = false;
StayToolStripMenuItem. Text = «Distribution of cards»;
StayToolStripMenuItem. Enabled = true;
MenuToolStripMenuItem. Text = «Menu»;
MenuToolStripMenuItem. Enabled = true;
//An applause in our address for a prize in cards:
Assembly a1 = Assembly.GetExecutingAssembly ();
Stream s1 =
a1.GetManifestResourceStream (
«PocketJack. pj_claps. wav»);
SoundPlayer player1 = new SoundPlayer (s1);
player1.Play ();
break;
case GameMode.PlayerBust:
BetMinusToolStripMenuItem1.Enabled = false;
BetPlusToolStripMenuItem. Enabled = false;
HitMeToolStripMenuItem. Enabled = false;
StayToolStripMenuItem. Text = «Distribution of cards»;
StayToolStripMenuItem. Enabled = true;
MenuToolStripMenuItem. Text = «Menu»;
MenuToolStripMenuItem. Enabled = true;
//Discontent of support group with our exceeding of
//cards:
Assembly a2 = Assembly.GetExecutingAssembly ();
Stream s2 =
a2.GetManifestResourceStream (
«PocketJack. pj_busted. wav»);
SoundPlayer player2 = new SoundPlayer (s2);
player2.Play ();
break;
case GameMode. PocketJack:
BetMinusToolStripMenuItem1.Enabled = false;
BetPlusToolStripMenuItem. Enabled = false;
HitMeToolStripMenuItem. Enabled = false;
StayToolStripMenuItem. Text = «Distribution of cards»;
StayToolStripMenuItem. Enabled = true;
MenuToolStripMenuItem. Text = «Menu»;
MenuToolStripMenuItem. Enabled = true;
//A victorious tune after Pocket Jack with 21 points:
Assembly a3 = Assembly.GetExecutingAssembly ();
Stream s3 =
a3.GetManifestResourceStream (
«PocketJack. pj_pj. wav»);
SoundPlayer player3 = new SoundPlayer (s3);
player3.Play ();
break;
case GameMode.DealerActive:
BetMinusToolStripMenuItem1.Enabled = false;
BetPlusToolStripMenuItem. Enabled = false;
HitMeToolStripMenuItem. Enabled = false;
StayToolStripMenuItem. Text = «Distribution of cards»;
StayToolStripMenuItem. Enabled = false;
MenuToolStripMenuItem. Text = «Menu»;
MenuToolStripMenuItem. Enabled = true;
break;
case GameMode.DealerWon:
BetMinusToolStripMenuItem1.Enabled = false;
BetPlusToolStripMenuItem. Enabled = false;
HitMeToolStripMenuItem. Enabled = false;
StayToolStripMenuItem. Text = «Distribution of cards»;
StayToolStripMenuItem. Enabled = true;
MenuToolStripMenuItem. Text = «Menu»;
MenuToolStripMenuItem. Enabled = true;
//Discontent of support group with our exceeding of
//cards:
Assembly a4 = Assembly.GetExecutingAssembly ();
Stream s4 =
a4.GetManifestResourceStream (
«PocketJack. pj_busted. wav»);
SoundPlayer player4 = new SoundPlayer (s4);
player4.Play ();
break;
case GameMode.DealerBust:
BetMinusToolStripMenuItem1.Enabled = false;
BetPlusToolStripMenuItem. Enabled = false;
HitMeToolStripMenuItem. Enabled = false;
StayToolStripMenuItem. Text = «Distribution of cards»;
StayToolStripMenuItem. Enabled = true;
MenuToolStripMenuItem. Text = «Menu»;
MenuToolStripMenuItem. Enabled = true;
//An applause in our address for a prize in cards:
Assembly a5 = Assembly.GetExecutingAssembly ();
Stream s5 =
a5.GetManifestResourceStream (
«PocketJack. pj_claps. wav»);
SoundPlayer player5 = new SoundPlayer (s5);
player5.Play ();
break;
case GameMode. Push:
BetMinusToolStripMenuItem1.Enabled = false;
BetPlusToolStripMenuItem. Enabled = false;
HitMeToolStripMenuItem. Enabled = false;
StayToolStripMenuItem. Text = «Distribution of cards»;
StayToolStripMenuItem. Enabled = true;
MenuToolStripMenuItem. Text = «Menu»;
MenuToolStripMenuItem. Enabled = true;
break;
}
modeValue = value;
this.Invalidate ();
}
}
//We load the game objects:
public void init ()
{
System.Reflection.Assembly asm =
System.Reflection.Assembly.GetExecutingAssembly ();
loadingImage = new Bitmap(asm.GetManifestResourceStream (
"PocketJack.images.loading.gif»));
bankImage = new Bitmap(asm.GetManifestResourceStream (
"PocketJack.images.bank.jpg»));
mode