コード例 #1
0
ファイル: Kernel.cs プロジェクト: Zino2201/Cosmos
        protected override void Run()
        {
            /*
             * Charles needs to fix FAT for this to work, but basically what it does
             * is it takes input from the user, and if it is 'ls', it lists all
             * files in 0:\\, and if not, it interprets the input as a file path
             * and creates a new zConsole.ZConsoleScreen() instance, which
             * loads the file, and interprets it as a Z-Machine game.
             * If something bad happens, the exception is written to the
             * console and the user is told to specify a path again.
             */

            Console.WriteLine("Specify game path:");
            string fName = null;
            try
            {
                fName = Console.ReadLine();
                if (fName == "ls")
                {
                    foreach (var dir in Directory.GetFiles("0:\\"))
                    {
                        Console.WriteLine($"0:\\{dir}");
                    }
                }
                else
                {
                    var screen = new ZConsoleScreen(fName, GameData);
                }
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: ChrisJamesSadler/Cosmos
 static void Main(string[] args)
 {
     Frotz.os_.debug_mode = false;
     if (File.Exists("debug.log"))
         File.Delete("debug.log");
     string fName = "";
     while(!File.Exists(fName))
     {
         Console.WriteLine("Please type a path to a storyfile:");
         fName = Console.ReadLine();
     }
     var screen = new ZConsoleScreen(fName);
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: Zino2201/Cosmos
        static void Main(string[] args)
        {
            //byte[] xBytes;
            //using (var xGameStr = typeof(Program).Assembly.GetManifestResourceStream(typeof(Program), "ZORK1.DAT"))
            //{
            //    xBytes = new byte[xGameStr.Length];
            //    xGameStr.Read(xBytes, 0, xBytes.Length);
            //}

            Frotz.os_.debug_mode = false;
            //if (File.Exists("debug.log"))
            //    File.Delete("debug.log");
            string fName = "";
            //while(!File.Exists(fName))
            //{
            //    Console.WriteLine("Please type a path to a storyfile:");
            //    fName = Console.ReadLine();
            //}
            var screen = new ZConsoleScreen(fName, GameBytes);
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: yongweisun/Cosmos
        static void Main(string[] args)
        {
            //byte[] xBytes;
            //using (var xGameStr = typeof(Program).Assembly.GetManifestResourceStream(typeof(Program), "ZORK1.DAT"))
            //{
            //    xBytes = new byte[xGameStr.Length];
            //    xGameStr.Read(xBytes, 0, xBytes.Length);
            //}


            Frotz.os_.debug_mode = false;
            //if (File.Exists("debug.log"))
            //    File.Delete("debug.log");
            string fName = "";
            //while(!File.Exists(fName))
            //{
            //    Console.WriteLine("Please type a path to a storyfile:");
            //    fName = Console.ReadLine();
            //}
            var screen = new ZConsoleScreen(fName, GameBytes);
        }