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


C# Engine.Start方法代码示例

本文整理汇总了C#中Engine.Start方法的典型用法代码示例。如果您正苦于以下问题:C# Engine.Start方法的具体用法?C# Engine.Start怎么用?C# Engine.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Engine的用法示例。


在下文中一共展示了Engine.Start方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

        // public static void PlayerTurn(Player player, Tile[] tiles, int firstRoll, int secondRoll)
        // {
        //    Tile currentTile;
        //    player.Move(firstRoll + secondRoll, tiles.Length);
        //    if (tiles[player.Position] != null)
        //    {
        //        currentTile = tiles[player.Position];
        //        currentTile.Action(player);
        //    }
        //    Delegates.PrintingMethodInstance(player);
        // }
        public static void Main(string[] args)
        {
            IEngine engine = new Engine();
            engine.Start();
            Console.WriteLine("Game over");

            // while (board.PlayerCount > 1)
            // {
            //    foreach (Player player in board.Players)
            //    {
            //        int firstRoll = Dice.Roll();
            //        int secondRoll = Dice.Roll();
            //        Delegates.PrintingMethodInstance(String.Format("{0} rolls dice...", player.Name));
            //        Delegates.PrintingMethodInstance(String.Format("first dice rolled: {0} second dice rolled: {1}", firstRoll, secondRoll));

            //        PlayerTurn(player, board.Tiles, firstRoll, secondRoll);

            //        if (player.IsBankrupt)
            //        {
            //            board.RemovePlayer(player);
            //            if (board.PlayerCount <= 1)
            //            {
            //                Delegates.PrintingMethodInstance(String.Format("{0} Wins !", board.Players[0].Name));
            //                break;
            //            }
            //        }
            //    }
            // }
        }
开发者ID:GAlex7,项目名称:TA,代码行数:40,代码来源:Game.cs

示例2: TestPerformAttemptPopSuccessful

        public void TestPerformAttemptPopSuccessful()
        {
            string inputCommand = "" + Environment.NewLine + "3 3" + Environment.NewLine + "exit" + Environment.NewLine;

            StringBuilder stringBuilder = new StringBuilder();

            using (StringReader stringReader = new StringReader(inputCommand))
            {
                Console.SetIn(stringReader);

                using (StringWriter stringWriter = new StringWriter(stringBuilder))
                {
                    Console.SetOut(stringWriter);

                    IRenderer consoleRenderer = new ConsoleRenderer();

                    Engine engine = new Engine(consoleRenderer);

                    engine.Start();
                }
            }

            string gameData = stringBuilder.ToString();

            string actual = gameData.Substring(gameData.Length - 55);
            string expected = "Thank you for playing Balloons Pop! Have a great day!" + Environment.NewLine;

            Assert.AreEqual(expected, actual);
        }
开发者ID:Anubis-Black,项目名称:TeamIodine,代码行数:29,代码来源:TestEngine.cs

示例3: Main

 static void Main(string[] args)
 {
     // ei go na pochva
     Engine game = new Engine();
     game.Start();
     // i do tuka ne stigam
 }
开发者ID:TeamXenon,项目名称:BattleField,代码行数:7,代码来源:Program.cs

示例4: Main

        public static void Main(string[] args)
        {
            var eng = new Engine();
            eng.Start();

            Process.Start("http://localhost:9999/index.html");

            eng.WaitForExit();

            Console.WriteLine("Finished!");
        }
开发者ID:dtao,项目名称:SimpleDevelop,代码行数:11,代码来源:Main.cs

示例5: StartEngine

 public virtual void StartEngine(Engine engine)
 {
     try
     {
         engine.WarmUp();
         engine.Start();
     }
     catch (InvalidOperationException e)
     {
         Console.WriteLine(e.Message + "engine number: " + Engines.IndexOf(engine));
     }
 }
开发者ID:IvanShvetsAMD,项目名称:InternshipStuff,代码行数:12,代码来源:PoweredAircraft.cs

示例6: Main

 static void Main(string[] args)
 {
     try
     {
         Console.WriteLine("Starting Cosmos CI Engine");
         var xEngine = new Engine();
         xEngine.HandleError = e => Console.WriteLine("Error occurred in engine: " + e.ToString());
         xEngine.Start();
         Console.WriteLine("Started. Press enter to exit");
         xEngine.Stop();
     }
     catch (Exception E)
     {
         Console.WriteLine("Error occurred: " + E.ToString());
     }
 }
开发者ID:gitter-badger,项目名称:CIEngine,代码行数:16,代码来源:Program.cs

示例7: Run

        public void Run()
        {
            var engine = new Engine();

            this.RegisterHandlers(engine);
            engine.Init();

            engine.Start();

            while (true)
            {
                var input = Console.ReadLine().ToLower();
                if (input.Equals("exit"))
                {
                    break;
                }
            }
        }
开发者ID:goosefraba19,项目名称:ktane-abe,代码行数:18,代码来源:App.cs

示例8: GameOverMessageTest

        public void GameOverMessageTest()
        {
            string inputFile = "EngineConsoleInput.txt";
            string command = "2\n0 0\n0 1\n1 0\n1 1\n";

            StreamWriter writer = new StreamWriter(inputFile);
            using (writer)
            {
                writer.WriteLine(command);
            }

            IEngine engine = new Engine();

            StreamReader consoleInput = new StreamReader(inputFile);

            string outputFile = "EngineConsoleOutput.txt";

            StreamWriter consoleOutput = new StreamWriter(outputFile);

            using (consoleInput)
            {
                Console.SetIn(consoleInput);

                using (consoleOutput)
                {
                    Console.SetOut(consoleOutput);
                    engine.Start();
                }
            }

            StreamReader consoleResult = new StreamReader(outputFile);

            string gameFieldLastLine = string.Empty;
            string expectedResult = @"Game over. Detonated mines: ";

            using (consoleResult)
            {
                string[] outputResult = consoleResult.ReadToEnd().Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                gameFieldLastLine = outputResult[outputResult.Length - 1].Substring(0, expectedResult.Length);
            }

            Assert.AreEqual(expectedResult, gameFieldLastLine);
        }
开发者ID:TeamXenon,项目名称:BattleField,代码行数:43,代码来源:EngineTests.cs

示例9: StartIntroMessageTest

        public void StartIntroMessageTest()
        {
            string inputFile = "EngineConsoleInput.txt";
            string command = "2\n0 0\n0 1\n1 0\n1 1\n";

            StreamWriter writer = new StreamWriter(inputFile);
            using (writer)
            {
                writer.WriteLine(command);
            }

            IEngine engine = new Engine();

            StreamReader consoleInput = new StreamReader(inputFile);

            string outputFile = "EngineConsoleOutput.txt";

            StreamWriter consoleOutput = new StreamWriter(outputFile);

            using (consoleInput)
            {
                Console.SetIn(consoleInput);

                using (consoleOutput)
                {
                    Console.SetOut(consoleOutput);
                    engine.Start();
                }
            }

            StreamReader consoleResult = new StreamReader(outputFile);

            string gameFieldFirstLine = string.Empty;

            using (consoleResult)
            {
                gameFieldFirstLine = consoleResult.ReadLine();
            }

            string expectedResult = @"Welcome to ""Battle Field"" game.";
            Assert.AreEqual(expectedResult, gameFieldFirstLine);
        }
开发者ID:TeamXenon,项目名称:BattleField,代码行数:42,代码来源:EngineTests.cs

示例10: Main

        static void Main()
        {
            IInputReader consoleReader = new ConsoleReader();
            var consoleWriter = new ConsoleWriter
            {
                AutoFlush = true
            };

            IUnitContainer unitMatrix = new MatrixContainer(MatrixRows, MatrixCols);
            ICommandDispatcher commandDispatcher = new ExtendedCommandDispatcher(); //CommandDispatcher();
            IUnitEffector unitEffector = new HealthEffector(); // EmptyUnitEffector();

            var engine = new Engine(unitMatrix,
                consoleReader,
                consoleWriter,
                commandDispatcher,
                unitEffector);

            engine.Start();
        }
开发者ID:RumenVassilev,项目名称:CSharpOOP,代码行数:20,代码来源:WinterIsComingMain.cs

示例11: Main

        static void Main(string[] args)
        {
            try
            {
                Console.WriteLine("Starting Cosmos CI Engine");
                var xEngine = new Engine();

                // for now hardcode configuration:
                xEngine.GithubOrganisation = "CosmosOS";
                xEngine.GithubRepository = "CIEngine";
                //xEngine.GithubRepository = "Cosmos";

                xEngine.HandleError = e => Console.WriteLine("Error occurred in engine: " + e.ToString());
                xEngine.Start();
                //Console.WriteLine("Started. Press enter to exit");
                //xEngine.Stop();
            }
            catch (Exception E)
            {
                Console.WriteLine("Error occurred: " + E.ToString());
            }
        }
开发者ID:transformersprimeabcxyz,项目名称:CIEngine-Cosmos,代码行数:22,代码来源:Program.cs

示例12: Main

 public static void Main()
 {
     Engine game = new Engine();
     game.Start();
 }
开发者ID:GStoykov,项目名称:BattleField,代码行数:5,代码来源:Program.cs

示例13: btnPrintSelected_Click

        private void btnPrintSelected_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                // Open a label format specifying a different printer
                if (cmbPrinterSelection.SelectedValue == null)
                {
                    Helper.ShowErrorMessageBox("Please select printer!");
                    return;
                }

                if (cbPrintQueue.IsChecked.Value)
                {
                    // Print queue barcode
                    BarcodeLabel selectedJob = dgPrintQueue.SelectedItem as BarcodeLabel;
                    if (selectedJob == null)
                    {
                        return;
                    }
                    PrintLineItemFromQueue(selectedJob.ID, selectedJob.WSNumber, selectedJob.LineID, selectedJob.ItemID - 1);
                    Helper.ShowInformationMessageBox("Label has been printed successfully!");
                }
                else
                {
                    // Print selected worksheet barcodes
                    using (Engine btEngine = new Engine())
                    {
                        btEngine.Start();
                        string fileName = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location) + @"\" + BarCodeConstants.BarcodeTemplateFileName;

                        List<BarcodeEntity> allBarcodeData = BusinessLogic.GetBarcodeDetails(txtQuoteNumber.Text);
                        if (allBarcodeData == null)
                        {
                            Helper.ShowErrorMessageBox("No data found for printing barcode!");
                            return;
                        }
                        foreach (QuoteGridEntity item in dgQuoteItems.SelectedItems)
                        {
                            if (item != null)
                            {
                                BarcodeEntity barcode = allBarcodeData.FirstOrDefault(x => int.Parse(x.Line) == item.LineID);
                                if (barcode == null)
                                {
                                    continue;
                                }
                                PrintLineItem(btEngine, fileName, barcode);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Logger.LogException(ex);
            }
        }
开发者ID:ultrasonicsoft,项目名称:G1,代码行数:56,代码来源:BarcodePrinter.xaml.cs

示例14: Debugger

 public void Debugger()
 {
     var engine = new Engine(typeof(EngineTester).GetMethod("DebuggerTest"));
     engine.Start();
 }
开发者ID:kthompson,项目名称:csharpos,代码行数:5,代码来源:EngineTester.cs

示例15: bw_DoWork

        private void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            LabelFormatDocument format = null; // The currently open Format
            Messages messages;
            //int waitForCompletionTimeout = 10000; // 10 seconds
            Result result;
            string strLabelFile;

            using (Engine engine = new Engine())
            {
                engine.Start();
                strLabelFile = Settings.GetLabelPath() + mobjSelectedLabel.LabelFile;
                //strLabelFile = Settings.GetLabelPath() + "John_Deere.btw";

                format = engine.Documents.Open(strLabelFile);

                if (chkMultiple.Checked)
                {
                    if (format.PrintSetup.SupportsIdenticalCopies)
                    {
                        //format.SubStrings["Print Count"].Value = int.Parse(txtQty.Text);
                        format.PrintSetup.IdenticalCopiesOfLabel = int.Parse(udCopies.Value.ToString());
                    }
                    if (format.PrintSetup.SupportsSerializedLabels)
                    {
                        /*For the below to work, you need to define serialization on the transforms tab of the barcode properties in Bartender*/
                        //format.SubStrings["Duplicate Count"].Value = udCopies.Value;
                        format.PrintSetup.NumberOfSerializedLabels = int.Parse(txtQty.Text);
                    }
                }
                else
                {
                    mobjItem.LabelSequence = mobjSelectedLabel.GetNextSequence();
                    try{ format.SubStrings["customerlabel.Sequence"].Value = mobjItem.LabelSequence.ToString(); }catch{}
                }

                foreach (var objSubString in format.SubStrings)
                {
                    switch (objSubString.Name)
                    {
                        /*I had to make all the text uppercase on "item.Item" or else barcoded labels in bartender wouldn't recognize the text
                         UPDATED - made "item.Item" uppercase by using the bartender software instead of code here*/
                        case "item.Item":
                            format.SubStrings[objSubString.Name].Value = mobjItem.ItemID.Trim();
                            break;
                        case "item.Description":
                            format.SubStrings[objSubString.Name].Value = mobjItem.Description.Trim();
                            break;
                        case "item.DrawingNmbr":
                            format.SubStrings[objSubString.Name].Value = mobjItem.DrawingNumber.Trim();
                            break;
                        case "item.ShippingAppItemNo":
                            format.SubStrings[objSubString.Name].Value = mobjItem.ShippingAppItemNo.Trim();
                            break;
                        case "item.Revision":
                            format.SubStrings[objSubString.Name].Value = mobjItem.Revision.Trim();
                            break;
                        case "co.MfgOrder":
                            format.SubStrings[objSubString.Name].Value = mobjItem.SelectedOrder.CustomerOrderNumber.Trim() + mobjItem.SelectedJob.JobNumber.Trim();
                            break;
                        case "co.Order":
                            format.SubStrings[objSubString.Name].Value = mobjItem.SelectedOrder.CustomerOrderNumber.Trim();
                            break;
                        case "co.CustPartNo":
                            format.SubStrings[objSubString.Name].Value = mobjItem.CustomerItem.Trim(); //.Replace("#", "")
                            break;
                        case "co.Supplier":
                            format.SubStrings[objSubString.Name].Value = txtSupplier.Text.Trim();
                            break;
                        case "co.CustNo":
                            format.SubStrings[objSubString.Name].Value = txtCustomer.Text;
                            break;
                        case "co.CustPO":
                            format.SubStrings[objSubString.Name].Value = mobjItem.SelectedOrder.CustomerPO.Trim();
                            break;
                        case "bol.GrossWeight":
                            format.SubStrings[objSubString.Name].Value = mobjBOL.GrossWeight.ToString();
                            break;
                        case "bol.TareWeight":
                            format.SubStrings[objSubString.Name].Value = mobjBOL.TareWeight.ToString();
                            break;
                        case "bol.NetWeight":
                            format.SubStrings[objSubString.Name].Value = mobjBOL.NetWeight.ToString();
                            break;
                        case "bol.PieceCt":
                            format.SubStrings[objSubString.Name].Value = mobjBOL.Quantity.ToString();
                            break;
                        case "bol.AvgPcWeight":
                            format.SubStrings[objSubString.Name].Value = mobjBOL.AveragePieceWeight.ToString("F3");
                            break;
                        case "bol.Cartons":
                            format.SubStrings[objSubString.Name].Value = txtCartons.Text.Trim();
                            break;
                        case "customeraddress.Address":
                            format.SubStrings[objSubString.Name].Value = txtAddress.Text.Trim();
                            break;
                    }
                }

                format.PrintSetup.PrinterName = e.Argument.GetValueFromAnonymousType<string>("PrinterName");
//.........这里部分代码省略.........
开发者ID:JakeLardinois,项目名称:WTF_ShippingApp,代码行数:101,代码来源:frmPrintLabel.cs


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