本文整理汇总了C#中System.IO.StreamReader.ReadAndType方法的典型用法代码示例。如果您正苦于以下问题:C# StreamReader.ReadAndType方法的具体用法?C# StreamReader.ReadAndType怎么用?C# StreamReader.ReadAndType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IO.StreamReader
的用法示例。
在下文中一共展示了StreamReader.ReadAndType方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GameStory
public static void GameStory()
{
using (StreamReader sr = new StreamReader(@"..\..\Text\Story.txt"))
{
sr.ReadAndType();
}
Console.WriteLine();
Console.WriteLine(" PRESS ANY KEY TO CHOOSE LEVEL AND START YOUR BATTLE...");
Reaction.Wait();
}
示例2: LevelFinished
protected override void LevelFinished()
{
Console.Clear();
this.ChangeConsoleColor(ConsoleColor.Yellow);
using (StreamReader sr = new StreamReader(@"..\..\Text\DemonVaultFinished.txt"))
{
sr.ReadAndType();
}
this.Hero.ResetHealth();
this.Hero.IncreaseAgility(this.Hero.PlayerStats.Agility); //this will double the hero agility
this.ChangeConsoleColor(ConsoleColor.White);
Reaction.Wait();
}
示例3: Intro
protected override void Intro()
{
using (StreamReader sr = new StreamReader(@"..\..\Text\DemonVaultIntro.txt"))
{
sr.ReadAndType();
}
Reaction.Wait();
}
示例4: LevelFinished
protected override void LevelFinished()
{
bool crossbowChoice;
if (this.Hero.PlayerStats.Stamina > 0)
{
Console.Clear();
using (StreamReader sr = new StreamReader(@"..\..\Text\ZombieMountainFinished.txt"))
{
sr.ReadAndType();
}
}
crossbowChoice = Reaction.CheckKey(ConsoleKey.Spacebar, ConsoleKey.Escape);
if (crossbowChoice)
{
Thread.Sleep(1500);
Console.WriteLine("\nPicking up the item!");
this.Hero.Weapon = Weapon.CrossBow;
}
else
{
Thread.Sleep(1500);
Console.WriteLine("\nOKAY! I did say it will come in handy though!");
}
Thread.Sleep(1500);
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("\nCONGRATULATIONS!");
Thread.Sleep(1500);
Console.WriteLine("\nYou have found a secret passage that helps you get out of this zombie hell!");
Console.ForegroundColor = ConsoleColor.Gray;
}
示例5: Intro
protected override void Intro()
{
Console.CursorVisible = false;
using (StreamReader sr = new StreamReader(@"..\..\Text\ZombieMountainIntro.txt"))
{
sr.ReadAndType();
}
Reaction.Wait();
}
示例6: LevelFinished
protected override void LevelFinished()
{
if (this.Hero.PlayerStats.Stamina > 0)
{
Console.Clear();
using (StreamReader sr = new StreamReader(@"..\..\Text\DarkForestFinished.txt"))
{
sr.ReadAndType();
}
bool decision = Reaction.CheckKey(ConsoleKey.Spacebar, ConsoleKey.Escape);
if (decision)
{
int increaseHealthValue = rand.Next(20, 31);
int decreaseAgilityValue = rand.Next(20, 31);
this.Hero.IncreaseHealth(increaseHealthValue);
this.Hero.DecreaseAgility(decreaseAgilityValue);
Console.WriteLine("+ {0} Health", increaseHealthValue);
Console.WriteLine("- {0} Agility", decreaseAgilityValue);
}
}
else
{
//TODO: Game Over
Console.WriteLine("Game Over!!!");
}
}