public async Task CreateWorkflowTemplateAsync() { Mock <WorkflowTemplateService.WorkflowTemplateServiceClient> mockGrpcClient = new Mock <WorkflowTemplateService.WorkflowTemplateServiceClient>(MockBehavior.Strict); mockGrpcClient.Setup(x => x.CreateOperationsClient()) .Returns(new Mock <Operations.OperationsClient>().Object); CreateWorkflowTemplateRequest expectedRequest = new CreateWorkflowTemplateRequest { ParentAsRegionName = new RegionName("[PROJECT]", "[REGION]"), Template = new WorkflowTemplate(), }; WorkflowTemplate expectedResponse = new WorkflowTemplate { Id = "id3355", WorkflowTemplateName = new WorkflowTemplateName("[PROJECT]", "[REGION]", "[WORKFLOW_TEMPLATE]"), Version = 351608024, }; mockGrpcClient.Setup(x => x.CreateWorkflowTemplateAsync(expectedRequest, It.IsAny <CallOptions>())) .Returns(new Grpc.Core.AsyncUnaryCall <WorkflowTemplate>(Task.FromResult(expectedResponse), null, null, null, null)); WorkflowTemplateServiceClient client = new WorkflowTemplateServiceClientImpl(mockGrpcClient.Object, null); RegionName parent = new RegionName("[PROJECT]", "[REGION]"); WorkflowTemplate template = new WorkflowTemplate(); WorkflowTemplate response = await client.CreateWorkflowTemplateAsync(parent, template); Assert.Same(expectedResponse, response); mockGrpcClient.VerifyAll(); }
protected JournalPresenter( IJournalView view, IRegionResolver regionResolver, IJournalPageToJournalPageDTOMapper mapper, IJournalTask journalTask, IViewItemContextMenuFactory viewItemContextMenuFactory, IJournalRetriever journalRetriever, IJournalPagePreviewPresenter previewPresenter, IJournalSearchPresenter searchPresenter, RegionName regionName) : base(view) { _mapper = mapper; _journalTask = journalTask; _viewItemContextMenuFactory = viewItemContextMenuFactory; _journalRetriever = journalRetriever; _previewPresenter = previewPresenter; _searchPresenter = searchPresenter; _region = regionResolver.RegionWithName(regionName); _allJournalPageDTOs = new NotifyList <JournalPageDTO>(); View.AddPreviewView(_previewPresenter.BaseView); View.AddSeachView(_searchPresenter.BaseView); AddSubPresenters(_previewPresenter, _searchPresenter); View.BindTo(_allJournalPageDTOs); View.SearchVisible = false; _journalSearch = null; _region.Add(View); }
private static RegionName createRegionName(string name, string caption, ApplicationIcon icon) { var newRegion = new RegionName(name, caption, icon); _allRegions.Add(newRegion); return(newRegion); }
protected override void Context() { base.Context(); _regionName = new RegionName("toto", "tata", null); _region = A.Fake <IRegion>(); A.CallTo(() => _container.Resolve <IRegion>(_regionName)).Returns(_region); }
/// <summary>Snippet for InstantiateInlineWorkflowTemplateAsync</summary> public async Task InstantiateInlineWorkflowTemplateAsync() { // Snippet: InstantiateInlineWorkflowTemplateAsync(string,WorkflowTemplate,CallSettings) // Additional: InstantiateInlineWorkflowTemplateAsync(string,WorkflowTemplate,CancellationToken) // Create client WorkflowTemplateServiceClient workflowTemplateServiceClient = await WorkflowTemplateServiceClient.CreateAsync(); // Initialize request argument(s) string formattedParent = new RegionName("[PROJECT]", "[REGION]").ToString(); WorkflowTemplate template = new WorkflowTemplate(); // Make the request Operation <Empty, WorkflowMetadata> response = await workflowTemplateServiceClient.InstantiateInlineWorkflowTemplateAsync(formattedParent, template); // Poll until the returned long-running operation is complete Operation <Empty, WorkflowMetadata> completedResponse = await response.PollUntilCompletedAsync(); // The long-running operation is now complete. // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name Operation <Empty, WorkflowMetadata> retrievedResponse = await workflowTemplateServiceClient.PollOnceInstantiateInlineWorkflowTemplateAsync(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // The long-running operation is now complete. } // End snippet }
public OSDMap PackRegionInfoData() { OSDMap args = new OSDMap(); args["region_id"] = OSD.FromUUID(RegionID); if ((RegionName != null) && !RegionName.Equals("")) args["region_name"] = OSD.FromString(RegionName); args["region_xloc"] = OSD.FromString(RegionLocX.ToString()); args["region_yloc"] = OSD.FromString(RegionLocY.ToString()); if (RegionType != String.Empty) args["region_type"] = OSD.FromString(RegionType); args["region_size_x"] = OSD.FromInteger(RegionSizeX); args["region_size_y"] = OSD.FromInteger(RegionSizeY); args["region_size_z"] = OSD.FromInteger(RegionSizeZ); args["InfiniteRegion"] = OSD.FromBoolean(InfiniteRegion); args["scope_id"] = OSD.FromUUID(ScopeID); args["all_scope_ids"] = AllScopeIDs.ToOSDArray(); args["object_capacity"] = OSD.FromInteger(m_objectCapacity); args["region_type"] = OSD.FromString(RegionType); args["see_into_this_sim_from_neighbor"] = OSD.FromBoolean(SeeIntoThisSimFromNeighbor); args["startupType"] = OSD.FromInteger((int) Startup); args["RegionSettings"] = RegionSettings.ToOSD(); args["GridSecureSessionID"] = GridSecureSessionID; if (EnvironmentSettings != null) args["EnvironmentSettings"] = EnvironmentSettings; args["OpenRegionSettings"] = OpenRegionSettings.ToOSD(); return args; }
/// <summary>Snippet for InstantiateInlineWorkflowTemplate</summary> public void InstantiateInlineWorkflowTemplate() { // Snippet: InstantiateInlineWorkflowTemplate(RegionName,WorkflowTemplate,CallSettings) // Create client WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.Create(); // Initialize request argument(s) RegionName parent = new RegionName("[PROJECT]", "[REGION]"); WorkflowTemplate template = new WorkflowTemplate(); // Make the request Operation <Empty, WorkflowMetadata> response = workflowTemplateServiceClient.InstantiateInlineWorkflowTemplate(parent, template); // Poll until the returned long-running operation is complete Operation <Empty, WorkflowMetadata> completedResponse = response.PollUntilCompleted(); // The long-running operation is now complete. // Or get the name of the operation string operationName = response.Name; // This name can be stored, then the long-running operation retrieved later by name Operation <Empty, WorkflowMetadata> retrievedResponse = workflowTemplateServiceClient.PollOnceInstantiateInlineWorkflowTemplate(operationName); // Check if the retrieved long-running operation has completed if (retrievedResponse.IsCompleted) { // The long-running operation is now complete. } // End snippet }
public string FixupRegionNameForSave() { var s = RegionName.Replace(" ", "____"); var validXmlChars = XmlConvert.EncodeName(s); return(validXmlChars); }
public OSDMap PackRegionInfoData() { OSDMap args = new OSDMap(); args["region_id"] = OSD.FromUUID(RegionID); if ((RegionName != null) && !RegionName.Equals("")) { args["region_name"] = OSD.FromString(RegionName); } args["external_host_name"] = OSD.FromString(ExternalHostName); args["http_port"] = OSD.FromString(HttpPort.ToString()); args["server_uri"] = OSD.FromString(ServerURI); args["region_xloc"] = OSD.FromString(RegionLocX.ToString()); args["region_yloc"] = OSD.FromString(RegionLocY.ToString()); args["internal_ep_address"] = OSD.FromString(InternalEndPoint.Address.ToString()); args["internal_ep_port"] = OSD.FromString(InternalEndPoint.Port.ToString()); if ((RemotingAddress != null) && !RemotingAddress.Equals("")) { args["remoting_address"] = OSD.FromString(RemotingAddress); } args["remoting_port"] = OSD.FromString(RemotingPort.ToString()); args["allow_alt_ports"] = OSD.FromBoolean(m_allow_alternate_ports); if ((proxyUrl != null) && !proxyUrl.Equals("")) { args["proxy_url"] = OSD.FromString(proxyUrl); } if (RegionType != String.Empty) { args["region_type"] = OSD.FromString(RegionType); } return(args); }
public override int GetHashCode() { int hashCompanyName = CompanyName == null ? 0 : CompanyName.GetHashCode(); int hashRegionName = RegionName == null ? 0 : RegionName.GetHashCode(); int hashSiteName = SiteName == null ? 0 : SiteName.GetHashCode(); return(hashCompanyName ^ hashRegionName ^ hashSiteName); }
public static string Lookup(RegionName regionName) { if (regionName == RegionName.Overlay) return REGION_OVERLAY; if (regionName == RegionName.Header) return REGION_HEADER; if (regionName == RegionName.Footer) return REGION_FOOTER; if (regionName == RegionName.Busy) return REGION_BUSY; return REGION_MAIN_AREA; }
private void ValidateRegionName() { string allNames = "centralus,eastasia,southeastasia,eastus,eastus2,westus,westus2,northcentralus,southcentralus,westcentralus,northeurope,westeurope,japaneast,japanwest,brazilsouth,australiasoutheast,australiaeast,westindia,southindia,centralindia,canadacentral,canadaeast,uksouth,ukwest,koreacentral,koreasouth,francecentral"; if (!allNames.Contains(RegionName.ToLower())) { throw new FormatException($"RegionName {RegionName} is not valid. Valid regions {allNames}"); } }
public RegionNeigbourMapSummaryViewModel(Neighbour neighbour) { Distance = neighbour.Passage.Distance; RegionName = neighbour.Region.Name; if (RegionName.Length > 13) { RegionName = RegionName.Substring(0, 10) + "..."; } }
private void registerRegion(UxDockPanel dockPanel, RegionName regionName) { //AUTOFAC var regionContainer = IoC.Resolve <RegionsContainer>(); regionContainer.Comparison = dockPanel; //CASTLE IoC.RegisterImplementationOf((IRegion)dockPanel, regionName.Name); dockPanel.InitializeWith(regionName); }
protected AbstractExplorerPresenter(TView view, IRegionResolver regionResolver, IClassificationPresenter classificationPresenter, IToolTipPartCreator toolTipPartCreator, RegionName regionName, IProjectRetriever projectRetriever) : base(view) { _regionResolver = regionResolver; _toolTipPartCreator = toolTipPartCreator; _regionName = regionName; _projectRetriever = projectRetriever; _classificationPresenter = classificationPresenter; _classificationPresenter.InitializeWith(this); }
public RegionWithHealthRisk AddRegionWithCases(RegionName region, int day, NumberOfPeople numCases) { return(new RegionWithHealthRisk() { Name = region, Days0to6 = 0, Days7to13 = 0, Days14to20 = 0, Days21to27 = 0 }); }
protected JournalDiagramMainPresenter( IJournalDiagramMainView view, IJournalDiagramPresenter journalDiagramPresenter, IRegionResolver regionResolver, RegionName regionName) : base(view) { _region = regionResolver.RegionWithName(regionName); View.InsertDiagram(journalDiagramPresenter.View); _region.Add(View); _journalDiagramPresenter = journalDiagramPresenter; }
/// <summary>Snippet for CreateWorkflowTemplate</summary> public void CreateWorkflowTemplate() { // Snippet: CreateWorkflowTemplate(RegionName,WorkflowTemplate,CallSettings) // Create client WorkflowTemplateServiceClient workflowTemplateServiceClient = WorkflowTemplateServiceClient.Create(); // Initialize request argument(s) RegionName parent = new RegionName("[PROJECT]", "[REGION]"); WorkflowTemplate template = new WorkflowTemplate(); // Make the request WorkflowTemplate response = workflowTemplateServiceClient.CreateWorkflowTemplate(parent, template); // End snippet }
public void GetAllCentreSummariesForFindCentre_returns_expected_summary() { //When var summaries = centresDataService.GetAllCentreSummariesForFindCentre().ToList(); //Then summaries.Should().HaveCount(315); summaries.Single(s => s.CentreId == 8) !.CentreName.Should().Be("Buckinghamshire Healthcare NHS Trust"); summaries.Single(s => s.CentreId == 2) !.RegionName.Should().Be("North West"); summaries.Single(s => s.CentreId == 190) !.Email.Should().BeNull(); summaries.Single(s => s.CentreId == 205) !.Telephone.Should().Be("01895 238282"); }
/// <summary>Snippet for CreateAutoscalingPolicy</summary> public void CreateAutoscalingPolicyResourceNames2() { // Snippet: CreateAutoscalingPolicy(RegionName, AutoscalingPolicy, CallSettings) // Create client AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create(); // Initialize request argument(s) RegionName parent = RegionName.FromProjectRegion("[PROJECT]", "[REGION]"); AutoscalingPolicy policy = new AutoscalingPolicy(); // Make the request AutoscalingPolicy response = autoscalingPolicyServiceClient.CreateAutoscalingPolicy(parent, policy); // End snippet }
/// <summary>Snippet for CreateAutoscalingPolicy</summary> public void CreateAutoscalingPolicy() { // Snippet: CreateAutoscalingPolicy(string,AutoscalingPolicy,CallSettings) // Create client AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = AutoscalingPolicyServiceClient.Create(); // Initialize request argument(s) string formattedParent = new RegionName("[PROJECT]", "[REGION]").ToString(); AutoscalingPolicy policy = new AutoscalingPolicy(); // Make the request AutoscalingPolicy response = autoscalingPolicyServiceClient.CreateAutoscalingPolicy(formattedParent, policy); // End snippet }
// override object.Equals public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) { return(false); } var other = (MetricIdentifier)obj; return(RegionName.Equals(other.RegionName, StringComparison.InvariantCultureIgnoreCase) && Identifier.Equals(other.Identifier, StringComparison.InvariantCultureIgnoreCase)); }
private void ActOK_Click(System.Object sender, System.EventArgs e) { // ----- The region name is required. if (RegionName.Text.Trim().Length == 0) { MessageBox.Show("Please provide a region name."); RegionName.Focus(); return; } // ----- Success. this.DialogResult = DialogResult.OK; }
private void PopulateControl() { try { IsEdit = true; txtRegionID.Text = RegionID.ToString(); txtRegionName.Text = RegionName.ToString(); } catch (Exception ex) { throw ex; } }
/// <summary>Snippet for CreateAutoscalingPolicyAsync</summary> public async Task CreateAutoscalingPolicyAsync() { // Snippet: CreateAutoscalingPolicyAsync(string,AutoscalingPolicy,CallSettings) // Additional: CreateAutoscalingPolicyAsync(string,AutoscalingPolicy,CancellationToken) // Create client AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync(); // Initialize request argument(s) string formattedParent = new RegionName("[PROJECT]", "[REGION]").ToString(); AutoscalingPolicy policy = new AutoscalingPolicy(); // Make the request AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(formattedParent, policy); // End snippet }
/// <summary>Snippet for CreateAutoscalingPolicyAsync</summary> public async Task CreateAutoscalingPolicyResourceNames2Async() { // Snippet: CreateAutoscalingPolicyAsync(RegionName, AutoscalingPolicy, CallSettings) // Additional: CreateAutoscalingPolicyAsync(RegionName, AutoscalingPolicy, CancellationToken) // Create client AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync(); // Initialize request argument(s) RegionName parent = RegionName.FromProjectRegion("[PROJECT]", "[REGION]"); AutoscalingPolicy policy = new AutoscalingPolicy(); // Make the request AutoscalingPolicy response = await autoscalingPolicyServiceClient.CreateAutoscalingPolicyAsync(parent, policy); // End snippet }
/// <summary>Snippet for CreateWorkflowTemplateAsync</summary> public async Task CreateWorkflowTemplateAsync() { // Snippet: CreateWorkflowTemplateAsync(RegionName,WorkflowTemplate,CallSettings) // Additional: CreateWorkflowTemplateAsync(RegionName,WorkflowTemplate,CancellationToken) // Create client WorkflowTemplateServiceClient workflowTemplateServiceClient = await WorkflowTemplateServiceClient.CreateAsync(); // Initialize request argument(s) RegionName parent = new RegionName("[PROJECT]", "[REGION]"); WorkflowTemplate template = new WorkflowTemplate(); // Make the request WorkflowTemplate response = await workflowTemplateServiceClient.CreateWorkflowTemplateAsync(parent, template); // End snippet }
public DataCollector( DataCollectorId id, DateTimeOffset lastActive, RegionName region, DistrictName district, Location location, Sex sex) { Id = id; LastActive = lastActive; Region = region; District = district; Location = location; Sex = sex; }
private void Activate() { if (String.IsNullOrEmpty(RegionName)) { return; } if (RegionName.Equals(RegionNames.MultiPageUpRegion)) { ControlViewManager.ActivateAllViewToRegionManager(RegionManagerNames.UpMultiTableRegionManager); } else if (RegionName.Equals(RegionNames.MultiPageBottomRegion)) { ControlViewManager.ActivateAllViewToRegionManager(RegionManagerNames.BottomMultiTableRegionManager); } }
protected override void RenderAttributes(XElement element, FoRenderOptions options) { if (RegionName.HasValue()) { element.Add(new XAttribute("region-name", RegionName)); } if (BackgroundRepeat.HasValue()) { element.Add(new XAttribute("background-repeat", BackgroundRepeat)); } if (BackgroundImage.HasValue()) { element.Add(new XAttribute("background-image", "url(" + BackgroundImage + ")")); } if (ColumnCount > 0) { element.Add(new XAttribute("column-count", ColumnCount)); } if (ColumnGap.HasValue()) { element.Add(new XAttribute("column-gap", ColumnGap)); } if (Extent.HasValue()) { element.Add(new XAttribute("extent", Extent)); } if (Margin.HasValue()) { element.Add(new XAttribute("margin", Margin)); } if (MarginTop.HasValue()) { element.Add(new XAttribute("margin-top", MarginTop)); } if (MarginRight.HasValue()) { element.Add(new XAttribute("margin-right", MarginRight)); } if (MarginBottom.HasValue()) { element.Add(new XAttribute("margin-bottom", MarginBottom)); } if (MarginLeft.HasValue()) { element.Add(new XAttribute("margin-left", MarginLeft)); } }
/// <summary>Snippet for ListAutoscalingPolicies</summary> public async Task ListAutoscalingPoliciesResourceNames2Async() { // Snippet: ListAutoscalingPoliciesAsync(RegionName, string, int?, CallSettings) // Create client AutoscalingPolicyServiceClient autoscalingPolicyServiceClient = await AutoscalingPolicyServiceClient.CreateAsync(); // Initialize request argument(s) RegionName parent = RegionName.FromProjectRegion("[PROJECT]", "[REGION]"); // Make the request PagedAsyncEnumerable <ListAutoscalingPoliciesResponse, AutoscalingPolicy> response = autoscalingPolicyServiceClient.ListAutoscalingPoliciesAsync(parent); // Iterate over all response items, lazily performing RPCs as required await response.ForEachAsync((AutoscalingPolicy item) => { // Do something with each item Console.WriteLine(item); }); // Or iterate over pages (of server-defined size), performing one RPC per page await response.AsRawResponses().ForEachAsync((ListAutoscalingPoliciesResponse page) => { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (AutoscalingPolicy item in page) { // Do something with each item Console.WriteLine(item); } }); // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; Page <AutoscalingPolicy> singlePage = await response.ReadPageAsync(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); foreach (AutoscalingPolicy item in singlePage) { // Do something with each item Console.WriteLine(item); } // Store the pageToken, for when the next page is required. string nextPageToken = singlePage.NextPageToken; // End snippet }
public Region findRegionByName(RegionName name) { Region res = null; foreach (var item in m_lRegionList) { if (item.name == name) { res = item; break; } } return res; }
public void InitUnits() { int ID = 0; foreach (var item in m_lPlayerList) { for (int i = 0; i < 5; i++) { Unit u = new Unit(); Unit tempUnit = u.CreateSoldier(item.playerHouse); ID++; tempUnit.ID = ID; switch (item.playerHouse) { case HOUSE.GREYJOY: {//kesz RegionName[] avaiableNext = new RegionName[] { RegionName.PYKE, RegionName.SEAGARD, RegionName.FLINTS_FINGER }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.LANNISTER: {//kesz RegionName[] avaiableNext = new RegionName[] { RegionName.LANNISPORT, RegionName.SEAROAD_MARCHES, RegionName.STONEY_SEPT }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.TYRELL: {//kesz RegionName[] avaiableNext = new RegionName[] { RegionName.HIGHGARDEN, RegionName.THE_REACH, RegionName.DORNISH_MARCHES }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.STARKS: {//kesz RegionName[] avaiableNext = new RegionName[] { RegionName.CASTLE_BLACK, RegionName.WINTERFELL, RegionName.THE_STONY_SHORE }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.BARATHEON: { RegionName[] avaiableNext = new RegionName[] { RegionName.DRAGONSTONE, RegionName.KINGSWOOD, RegionName.KINGS_LANDING }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.MARTELL: { RegionName[] avaiableNext = new RegionName[] { RegionName.SUNSPEAR, RegionName.SALT_SHORE, RegionName.YRONWOOD }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.NONE: new Exception("hiba line: 1316"); break; default: break; } m_lUnitsList.Add(tempUnit); } for (int i = 0; i < 3; i++) { Unit u = new Unit(); Unit tempUnit = u.CreateKnight(item.playerHouse); ID++; tempUnit.ID = ID; switch (item.playerHouse) { case HOUSE.GREYJOY: {//kesz RegionName[] avaiableNext = new RegionName[] { RegionName.PYKE, RegionName.SEAGARD, RegionName.FLINTS_FINGER }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.LANNISTER: {//kesz RegionName[] avaiableNext = new RegionName[] { RegionName.LANNISPORT, RegionName.SEAROAD_MARCHES, RegionName.STONEY_SEPT }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.TYRELL: {//kesz RegionName[] avaiableNext = new RegionName[] { RegionName.HIGHGARDEN, RegionName.THE_REACH, RegionName.DORNISH_MARCHES }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.STARKS: {//kesz RegionName[] avaiableNext = new RegionName[] { RegionName.CASTLE_BLACK, RegionName.WINTERFELL, RegionName.THE_STONY_SHORE }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.BARATHEON: { RegionName[] avaiableNext = new RegionName[] { RegionName.DRAGONSTONE, RegionName.KINGSWOOD, RegionName.KINGS_LANDING }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.MARTELL: { RegionName[] avaiableNext = new RegionName[] { RegionName.SUNSPEAR, RegionName.SALT_SHORE, RegionName.YRONWOOD }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.NONE: new Exception("hiba line: 1316"); break; default: break; } m_lUnitsList.Add(tempUnit); } for (int i = 0; i < 2; i++) { Unit u = new Unit(); Unit tempUnit = u.CreateMachine(item.playerHouse); ID++; tempUnit.ID = ID; switch (item.playerHouse) { case HOUSE.GREYJOY: {//kesz RegionName[] avaiableNext = new RegionName[] { RegionName.PYKE, RegionName.SEAGARD, RegionName.FLINTS_FINGER }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.LANNISTER: {//kesz RegionName[] avaiableNext = new RegionName[] { RegionName.LANNISPORT, RegionName.SEAROAD_MARCHES, RegionName.STONEY_SEPT }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.TYRELL: {//kesz RegionName[] avaiableNext = new RegionName[] { RegionName.HIGHGARDEN, RegionName.THE_REACH, RegionName.DORNISH_MARCHES }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.STARKS: {//kesz RegionName[] avaiableNext = new RegionName[] { RegionName.CASTLE_BLACK, RegionName.WINTERFELL, RegionName.THE_STONY_SHORE }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.BARATHEON: { RegionName[] avaiableNext = new RegionName[] { RegionName.DRAGONSTONE, RegionName.KINGSWOOD, RegionName.KINGS_LANDING }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.MARTELL: { RegionName[] avaiableNext = new RegionName[] { RegionName.SUNSPEAR, RegionName.SALT_SHORE, RegionName.YRONWOOD }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.NONE: new Exception("hiba line: 1316"); break; default: break; } m_lUnitsList.Add(tempUnit); } for (int i = 0; i < 4; i++) { Unit u = new Unit(); Unit tempUnit = u.CreateShip(item.playerHouse); ID++; tempUnit.ID = ID; switch (item.playerHouse) { case HOUSE.GREYJOY: {//kesz RegionName[] avaiableNext = new RegionName[] { RegionName.PYKE, RegionName.SEAGARD, RegionName.FLINTS_FINGER }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.LANNISTER: {//kesz RegionName[] avaiableNext = new RegionName[] { RegionName.LANNISPORT, RegionName.SEAROAD_MARCHES, RegionName.STONEY_SEPT }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.TYRELL: {//kesz RegionName[] avaiableNext = new RegionName[] { RegionName.HIGHGARDEN, RegionName.THE_REACH, RegionName.DORNISH_MARCHES }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.STARKS: {//kesz RegionName[] avaiableNext = new RegionName[] { RegionName.CASTLE_BLACK, RegionName.WINTERFELL, RegionName.THE_STONY_SHORE }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.BARATHEON: { RegionName[] avaiableNext = new RegionName[] { RegionName.DRAGONSTONE, RegionName.KINGSWOOD, RegionName.KINGS_LANDING }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.MARTELL: { RegionName[] avaiableNext = new RegionName[] { RegionName.SUNSPEAR, RegionName.SALT_SHORE, RegionName.YRONWOOD }; Random rnd = new Random(); RegionName next = avaiableNext[rnd.Next(0, avaiableNext.Count())]; tempUnit.position = findRegionByName(next); } break; case HOUSE.NONE: new Exception("hiba line: 1316"); break; default: break; } m_lUnitsList.Add(tempUnit); } } }
public void ShowView(String viewName, RegionName regionName) { var view = this._viewFactory.GetView(viewName); _regionManager.AddToRegion(regionName.ToString(), view); }
public void ShowView(String viewName, RegionName regionName, Action<UserControl> initialization) { var view = this._viewFactory.GetView(viewName); initialization.Invoke(view); _regionManager.AddToRegion(regionName.ToString(), view); }