public override void UpdateFrom(BuildingBlockMetaData sourceChild, ISession session) { var sourceSimulation = sourceChild as SimulationMetaData; if (sourceSimulation == null) { return; } base.UpdateFrom(sourceChild, session); SimulationMode = sourceSimulation.SimulationMode; BuildingBlocks.UpdateFrom <string, UsedBuildingBlockMetaData>(sourceSimulation.BuildingBlocks, session); updateObservedDataFrom(sourceSimulation.UsedObservedData); //Update results and charts only if simulation is loaded if (!sourceChild.IsLoaded) { return; } updateResultsFrom(sourceSimulation.SimulationResults, session); updateChartsFrom(sourceSimulation.Charts, session); updateSimulationAnalysesFrom(sourceSimulation.SimulationAnalyses, session); }
private void CheckForConnectionsThroughDiagonalUnwalkableElements() { foreach (BuildingBlock buildingBlock in BuildingBlocks.Values) { if (buildingBlock.Type == Tile.Types.Wall || buildingBlock.Type == Tile.Types.Furniture) { foreach (BuildingBlock neighbour in buildingBlock.BuildingBlockNeighbours) { if (neighbour.DistanceTo(buildingBlock) > 1) // Then it is a diagonal { var illegalConnectedPointCoordinateSetOne = Coordinate(buildingBlock.X, neighbour.Y, neighbour.Z); var illegalConnectedPointCoordinateSetTwo = Coordinate(neighbour.X, buildingBlock.Y, neighbour.Z); if (!BuildingBlocks.ContainsKey(illegalConnectedPointCoordinateSetOne) || !BuildingBlocks.ContainsKey(illegalConnectedPointCoordinateSetTwo)) { continue; } BuildingBlocks[illegalConnectedPointCoordinateSetOne].BuildingBlockNeighbours.Remove( BuildingBlocks[illegalConnectedPointCoordinateSetTwo]); BuildingBlocks[illegalConnectedPointCoordinateSetTwo].BuildingBlockNeighbours.Remove( BuildingBlocks[illegalConnectedPointCoordinateSetOne]); } } } } }
// // This method is invoked when the application has loaded and is ready to run. In this // method you should instantiate the window, load the UI into it and then make the window // visible. // // You have 17 seconds to return from this method, or iOS will terminate your application. // public override bool FinishedLaunching(UIApplication app, NSDictionary options) { global::Xamarin.Forms.Forms.Init(); BuildingBlocks.Init(); LoadApplication(new App()); return(base.FinishedLaunching(app, options)); }
protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); BuildingBlocks.Init(); LoadApplication(new App()); }
public virtual void UpdateFrom(ProjectMetaData sourceProject, ISession session) { Name = sourceProject.Name; Description = sourceProject.Description; Version = sourceProject.Version; UpdateContentFrom(sourceProject); BuildingBlocks.UpdateFrom <string, BuildingBlockMetaData>(sourceProject.BuildingBlocks, session); SimulationComparisons.UpdateFrom <string, SimulationComparisonMetaData>(sourceProject.SimulationComparisons, session); ParameterIdentifications.UpdateFrom <string, ParameterIdentificationMetaData>(sourceProject.ParameterIdentifications, session); SensitivityAnalyses.UpdateFrom <string, SensitivityAnalysisMetaData>(sourceProject.SensitivityAnalyses, session); AllObservedData.UpdateFrom <string, ObservedDataMetaData>(sourceProject.AllObservedData, session); }
/// <summary> /// Enumerates the building blocks for the particular category. /// </summary> /// <param name="categoryName">The name of the category to get the building blocks for.</param> /// <returns>An enumerator for the building blocks in the given category.</returns> public IEnumerable <BuildingBlock> EnumerateBuildingBlocksForCategory(string categoryName) { List <BuildingBlock> ans = new List <BuildingBlock>(); Category category = this.GetTfsBuildingBlockCategory(categoryName); if (category != null) { BuildingBlocks buildingBlocks = category.BuildingBlocks; for (int j = 1; j <= buildingBlocks.Count; j++) { BuildingBlock bb = buildingBlocks.Item(j); this.logger.Log(TraceEventType.Information, "Enumerating building block for category {3}: {0} hash {1} ID {2}", bb.Name, bb.GetHashCode(), bb.ID, categoryName); ans.Add(bb); } } return(ans); }
public virtual void AddBuildingBlock(BuildingBlockMetaData buildingBlock) { BuildingBlocks.Add(buildingBlock); }
public virtual void AddBuildingBlock(UsedBuildingBlockMetaData blockMetaData) { BuildingBlocks.Add(blockMetaData); }