当前位置: 首页>>代码示例>>C#>>正文


C# StreamReader.ReadAndType方法代码示例

本文整理汇总了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();
 }
开发者ID:TeamOscarWilde,项目名称:FantasyIsland,代码行数:10,代码来源:Story.cs

示例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();
        }
开发者ID:TeamOscarWilde,项目名称:FantasyIsland,代码行数:15,代码来源:DemonVaultLevel.cs

示例3: Intro

 protected override void Intro()
 {
     using (StreamReader sr = new StreamReader(@"..\..\Text\DemonVaultIntro.txt"))
     {
         sr.ReadAndType();
     }
     Reaction.Wait();
 }
开发者ID:TeamOscarWilde,项目名称:FantasyIsland,代码行数:8,代码来源:DemonVaultLevel.cs

示例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;
        }
开发者ID:TeamOscarWilde,项目名称:FantasyIsland,代码行数:31,代码来源:ZombieMountain.cs

示例5: Intro

 protected override void Intro()
 {
     Console.CursorVisible = false;
     using (StreamReader sr = new StreamReader(@"..\..\Text\ZombieMountainIntro.txt"))
     {
         sr.ReadAndType();
     }
     Reaction.Wait();
 }
开发者ID:TeamOscarWilde,项目名称:FantasyIsland,代码行数:9,代码来源:ZombieMountain.cs

示例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!!!");
     }
 }
开发者ID:TeamOscarWilde,项目名称:FantasyIsland,代码行数:26,代码来源:DarkForestLevel.cs


注:本文中的System.IO.StreamReader.ReadAndType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。