public void PrintWorld(World world) { string[] worldStrings = GenerateOutput.GetOutput(world); Console.WriteLine('\n'); foreach (var line in worldStrings) { Console.WriteLine(line); } }
public List <GenerateOutput> Generate(WorkshopLayoutInput input) { List <GenerateOutput> list = new List <GenerateOutput>(); for (int i = 0; i < input.ProductionLine; i++) { #region 返回生成的布局信息 GenerateOutput output = new GenerateOutput(); output.ProductionLine = (i + 1).ToString(); PedestalDto pedestalDto = new PedestalDto(); pedestalDto.ProductionLine = i + 1; //如果要保存到数据库,即生成模板实例, if (input.IsSave) { pedestalDto.WorkshopLayoutId = input.LayoutId; pedestalDto.ProjectId = input.ProjectId; } //左部或上部制梁台 pedestalDto.Area = "LU"; pedestalDto.Type = "ZL"; List <PedestalDto> LU_ZL_blocks = GenerateBlocks(pedestalDto, input.BeamPedestal, input.IsSave); //左部或上部存梁台 pedestalDto.Type = "CL"; List <PedestalDto> LU_CL_blocks = GenerateBlocks(pedestalDto, input.SaveBeam, input.IsSave); //左部或上部钢筋绑扎台 pedestalDto.Type = "GJ"; List <PedestalDto> LU_BZ_blocks = GenerateBlocks(pedestalDto, input.BindRebar, input.IsSave); //右部或下部制梁台 pedestalDto.Area = "RD"; pedestalDto.Type = "ZL"; List <PedestalDto> RD_ZL_blocks = GenerateBlocks(pedestalDto, input.BeamPedestal, input.IsSave); //右部或下部存梁台 pedestalDto.Type = "CL"; List <PedestalDto> RD_CL_blocks = GenerateBlocks(pedestalDto, input.SaveBeam, input.IsSave); //右部或下部钢筋绑扎台 pedestalDto.Type = "GJ"; List <PedestalDto> RD_BZ_blocks = GenerateBlocks(pedestalDto, input.BindRebar, input.IsSave); output.LU_BeamPedestal = LU_ZL_blocks; output.LU_SaveBeam = LU_CL_blocks; output.LU_BindRebar = LU_BZ_blocks; output.RD_BeamPedestal = RD_ZL_blocks; output.RD_SaveBeam = RD_CL_blocks; output.RD_BindRebar = RD_BZ_blocks; list.Add(output); #endregion } return(list); }
/// <summary> /// Executes full process of the order. /// It will get and set input string from the POST method, process the order dishes and output the results. /// </summary> /// <param name="order">The order which will receive the processed data.</param> /// <param name="inputString">The input string with data to be processed.</param> /// <returns>Order's OutputString after process is completed.</returns> public static string Execute(IOrder order, string inputString) { try { order.SetInputString(inputString); Orders.ProcessOrder(order); GenerateOutput.OutputOrder(order); return(order.OutputString); } catch (Exception ex) { return($"We got a problem: {ex.Message}"); } }
public void Generate(List <GenerationRequest> todo, int Value) { v.InnerText = (c as NumericUpDown).Value.ToString(); ShowOutputText(); GenerateOutput.Instance().AddGenerationRequests(todo); GenerateOutput.Instance().AddObserver(this); if (!GenerateOutput.Instance().IsRunning) { GenerateOutput.Instance().GO(); } }
public Task <List <GenerateOutput> > GetListByLayoutAndProject(PedestalInput input) { List <GenerateOutput> generateOutputs = new List <GenerateOutput>(); //根据布局和项目获取台座 var pedestalList = _repository.GetAll() .Where(q => q.WorkshopLayoutId == input.LayoutId && q.ProjectId == input.ProjectId) .Include(v => v.SubProject).ToList(); //获取生产线信息 var productLines = pedestalList.GroupBy(q => q.ProductionLine).Select(q => q.Key); foreach (var item in productLines) { #region 返回布局信息 //根据生产线过滤台座 var tempList = pedestalList.Where(q => q.ProductionLine == item); GenerateOutput output = new GenerateOutput(); output.ProductionLine = item.ToString(); //左部或上部钢筋绑扎台 var LU_BindRebar = tempList.Where(q => q.Type == "GJ" && q.Area == "LU").ToList(); //左部或上部制梁台 var LU_BeamPedestal = tempList.Where(q => q.Type == "ZL" && q.Area == "LU").ToList(); //左部或上部存梁台 var LU_SaveBeam = tempList.Where(q => q.Type == "CL" && q.Area == "LU").ToList(); //右部或下部钢筋绑扎台 var RD_BindRebar = tempList.Where(q => q.Type == "GJ" && q.Area == "RD").ToList(); //右部或下部制梁台 var RD_BeamPedestal = tempList.Where(q => q.Type == "ZL" && q.Area == "RD").ToList(); //右部或下部存梁台 var RD_SaveBeam = tempList.Where(q => q.Type == "CL" && q.Area == "RD").ToList(); output.LU_BindRebar = ObjectMapper.Map <List <PedestalDto> >(LU_BindRebar); output.LU_BeamPedestal = ObjectMapper.Map <List <PedestalDto> >(LU_BeamPedestal); output.LU_SaveBeam = ObjectMapper.Map <List <PedestalDto> >(LU_SaveBeam); output.RD_BindRebar = ObjectMapper.Map <List <PedestalDto> >(RD_BindRebar); output.RD_BeamPedestal = ObjectMapper.Map <List <PedestalDto> >(RD_BeamPedestal); output.RD_SaveBeam = ObjectMapper.Map <List <PedestalDto> >(RD_SaveBeam); generateOutputs.Add(output); #endregion } return(Task.FromResult(generateOutputs)); }
private static void Ticking() { FileWriter fileWriter = new FileWriter(Constants.FilePathOutput); Io.PrintWorld(Game.World); while (Game.IsWorldDead() && Io.KeepTicking()) { if (Io.IfSave()) { string[] worldString = GenerateOutput.GetOutput(Game.World); fileWriter.Save(worldString); } Game.Tick(); Io.PrintWorld(Game.World); } }
public string Get() { Program.game.Tick(); string display = GenerateOutput.GetOutputString(Program.game.World); string responseString = @" <div style='text-align:center;'> <h1 style='padding-top:10%; padding-bottom:20px;'> Game of Life </h1>" + $"<pre>{display}<pre> " + "<form action=\"\" method=\"get\"> " + "<button name=\"foo\" value=\"tick \">" + "tick" + "</button>" + "</form>" + "</div>"; return(responseString); }
public GenerateOutputTests() { _generateOutput = new GenerateOutput(); }