Example #1
0
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                var demoGames = new List<String>();
                foreach (var type in System.Reflection.Assembly.GetExecutingAssembly().GetTypes())
                    if (!demoGames.Contains(type.Namespace))
                        demoGames.Add(type.Namespace);
                foreach (var name in demoGames.Where(s => System.Reflection.Assembly.GetExecutingAssembly().GetType(s + ".settings", false) != null))
                    Console.WriteLine(name);

                var driver = new RMUD.SinglePlayer.Driver();
                driver.Start(System.Reflection.Assembly.GetExecutingAssembly(), Console.Write);
                while (driver.IsRunning)
                    driver.Input(Console.ReadLine());
            }
            else
            {
                var driver = new RMUD.SinglePlayer.Driver();
                driver.Start(args[0], Console.Write);
                while (driver.IsRunning)
                    driver.Input(Console.ReadLine());
            }

            Console.WriteLine("[Press any key to exit..]");
            Console.ReadKey();
        }
Example #2
0
 static void Main(string[] args)
 {
     var driver = new RMUD.SinglePlayer.Driver();
     driver.Start(typeof(Akko.Game).Assembly, Console.Write);
     while (driver.IsRunning)
         driver.Input(Console.ReadLine());
     Console.WriteLine("[Press any key to exit..]");
     Console.ReadKey();
 }
Example #3
0
        private void InputBox_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.Up)
            {
                MemoryScrollIndex -= 1;
                if (MemoryScrollIndex < 0)
                {
                    MemoryScrollIndex = 0;
                }
                if (MemoryScrollIndex < CommandMemory.Count)
                {
                    InputBox.Text = CommandMemory[MemoryScrollIndex];
                    InputBox.Focus();
                    InputBox.SelectAll();
                }

                e.Handled = true;
            }
            else if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.Down)
            {
                MemoryScrollIndex += 1;
                if (MemoryScrollIndex > CommandMemory.Count)
                {
                    MemoryScrollIndex = CommandMemory.Count;
                }
                if (MemoryScrollIndex < CommandMemory.Count)
                {
                    InputBox.Text = CommandMemory[MemoryScrollIndex];
                    InputBox.Focus();
                    InputBox.SelectAll();
                }

                e.Handled = true;
            }
            else if (e.Key == Key.Return)
            {
                var saveInput = InputBox.Text.Trim();

                try
                {
                    InputBox.Clear();
                    (OutputBox.Document as dynamic).body.innerHTML += "<font color=red>" + saveInput + "</font><br>";
                    Driver.Input(saveInput);
                    CommandMemory.Add(saveInput);
                    MemoryScrollIndex = CommandMemory.Count;
                }
                catch (Exception x)
                {
                    (OutputBox.Document as dynamic).body.innerHTML += "<br><font color=red>" + x.Message + "</font><br>";
                    InputBox.Text = saveInput;
                }

                e.Handled = true;
            }
        }
Example #4
0
        static void Main(string[] args)
        {
            var driver = new RMUD.SinglePlayer.Driver();

            driver.Start(typeof(Akko.Game).Assembly, Console.Write);
            while (driver.IsRunning)
            {
                driver.Input(Console.ReadLine());
            }
            Console.WriteLine("[Press any key to exit..]");
            Console.ReadKey();
        }
Example #5
0
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                var demoGames = new List <String>();
                foreach (var type in System.Reflection.Assembly.GetExecutingAssembly().GetTypes())
                {
                    if (!demoGames.Contains(type.Namespace))
                    {
                        demoGames.Add(type.Namespace);
                    }
                }
                foreach (var name in demoGames.Where(s => System.Reflection.Assembly.GetExecutingAssembly().GetType(s + ".settings", false) != null))
                {
                    Console.WriteLine(name);
                }


                var driver = new RMUD.SinglePlayer.Driver();
                driver.Start(System.Reflection.Assembly.GetExecutingAssembly(), Console.Write);
                while (driver.IsRunning)
                {
                    driver.Input(Console.ReadLine());
                }
            }
            else
            {
                var driver = new RMUD.SinglePlayer.Driver();
                driver.Start(args[0], Console.Write);
                while (driver.IsRunning)
                {
                    driver.Input(Console.ReadLine());
                }
            }

            Console.WriteLine("[Press any key to exit..]");
            Console.ReadKey();
        }