private void OnRowBecameInvisible(MapRow row) { row.BecameInvisible -= OnRowBecameInvisible; Destroy(row.gameObject); Map.Remove(row); Vector3 nextPosition = Map[Map.Count - 1].transform.position + Vector3.forward; Map.Add(SpawnRow(nextPosition, new PreviousPattern(Map, _container))); }
private MapRow SpawnRow(Vector3 startPosition, RowGenerationPattern pattern) { MapRow instRow = Instantiate(_rowTemplate, startPosition, Quaternion.identity, _mapRoot); instRow.name = Map.Count.ToString(); instRow.Init(pattern); instRow.Spawn(startPosition, Vector3.right); instRow.BecameInvisible += OnRowBecameInvisible; return(instRow); }
private void AddOptions(MapRow mapRow) { mapRow.MockOptions = MockOptions.First(mo => mo.AttributeTypeCode == mapRow.Attribute.AttributeType); var cboBox = (DataGridViewComboBoxCell)gridMap.Rows.Cast <DataGridViewRow>().Where(mr => mr.DataBoundItem == mapRow).First().Cells["MockType"]; //var cboBox = (DataGridViewComboBoxCell)gridMap.Rows[ row.Index].Cells["MockType"]; cboBox.DataSource = null; cboBox.DataSource = mapRow.MockOptions.Mocks.Select(m => m.Name).ToList(); cboBox.ReadOnly = false; }
public MapRow AddMapRow(string SourceUniqueName, string DestUniqueName) { MapRow rowMapRow = ((MapRow)(this.NewRow())); rowMapRow.ItemArray = new object[] { SourceUniqueName, DestUniqueName }; this.Rows.Add(rowMapRow); return(rowMapRow); }
void DrawRow(MapRow drawRow) { drawX = 0; transform.position = new Vector3(drawX, drawY);//restes the drawer to start x foreach (MapBlock drawBlock in drawRow.rowBlocks) { GameObject.Instantiate(drawBlock, this.transform.position, this.transform.rotation); drawBlock.spawned = true; NextBlockLocation(); } }
public static void Initialize() { Language = "PtBr"; if (MapColumn.Equals(0)) { MapColumn = 3; } if (MapRow.Equals(0)) { MapRow = 3; } }
public MapRow AddMapRow(string Name, int ReplayID) { MapRow rowMapRow = ((MapRow)(this.NewRow())); rowMapRow.ItemArray = new object[] { null, Name, ReplayID }; this.Rows.Add(rowMapRow); return(rowMapRow); }
void InstantiateElements(MapInfo mapInfo) { for (int i = 0; i < mapInfo.tileMap.Count; i++) { MapRow mapRow = mapInfo.tileMap[i]; for (int j = 0; j < mapRow.tiles.Count; j++) { MapTile mapTile = mapRow.tiles[j]; GridCell cell = cells[i][j]; cell.tile = tileFactory.CreateNewTile(mapTile.tileType); // TODO: Esto lo necesitamos? cell.xPos = i; cell.yPos = j; // ----------- Vector2 gridPosition = new Vector2(i, j); Vector3 worldPosition = CalculateWorldPosition(gridPosition); cell.tile.transform.position = worldPosition; cell.tile.name = "tile" + i + "|" + j; cell.tile.resistance = mapTile.tileResist; cell.tile.X = i; cell.tile.Y = j; // If has actor if (mapTile.actorType >= 0) { Actor actor = actorFactory.CreateNewActor(mapTile.actorType); actor.name = "actor" + i + "|" + j; // Ultra hack, no hagan esto en casa chicxs Fire fire = actor as Fire; if (fire != null) { cell.tile.Fire = fire; } else { cell.tile.Actor = actor; } actor.transform.parent = cell.tile.transform; } } } SetNeighbors(cells); }
public MapPosition GetNextPosition(MapPosition from, Vector2Int direction) { int nextRowIndex = _generator.Map.IndexOf(from.Row) + direction.y; MapRow nextRow = _generator.Map[nextRowIndex]; int nextRowPosition = from.RowPosition + direction.x; if (nextRowPosition < 0 || nextRowPosition >= nextRow.Count) { return(from); } return(new MapPosition(nextRow, nextRowPosition)); }
private List <int> GetRandomNextPositions(MapRow previousRow) { List <int> emptyPositions = previousRow.GetEmptyPositions(); List <int> emptyCopy = new List <int>(emptyPositions); int firstPath = emptyPositions[Random.Range(0, emptyPositions.Count / 2)]; int secondPath = emptyPositions[Random.Range(emptyPositions.Count / 2, emptyPositions.Count)]; if (IsTrue(0.05f)) { if (IsTrue(0.5f)) { firstPath = secondPath; } else { secondPath = firstPath; } } foreach (var item in emptyPositions) { int neighborsCount = 0; if (emptyCopy.Contains(item - 1)) { neighborsCount++; } if (emptyCopy.Contains(item + 1)) { neighborsCount++; } if (IsTrue((0.4f + neighborsCount * 0.2f))) { emptyCopy.Remove(item); } } if (emptyCopy.Contains(firstPath) == false) { emptyCopy.Add(firstPath); } if (emptyCopy.Contains(secondPath) == false) { emptyCopy.Add(secondPath); } return(emptyCopy); }
public override List <MapObject> GenerateRow(int size) { _row = new List <MapObject>(size); for (int i = 0; i < size; i++) { _row.Add(ObjectContainer.GetObject <Wall>()); } MapRow lastRow = Map[Map.Count - 1]; List <int> nextPositions = GetRandomNextPositions(lastRow); for (int i = 0; i < nextPositions.Count; i++) { AddEmptyCell(nextPositions[i]); } return(_row); }
private MapRow _row10NewTilesY; // row 10: position Y of the new tiles private void InitializeCombatMapStructures(string dataFilenameAndPath, int fileOffset) { FileStream fs = File.OpenRead(dataFilenameAndPath); fs.Seek(fileOffset, SeekOrigin.Begin); _row0 = (MapRow)Utils.ReadStruct(fs, typeof(MapRow)); _row1To4Player.Add((MapPlayerPosRow)Utils.ReadStruct(fs, typeof(MapPlayerPosRow))); _row1To4Player.Add((MapPlayerPosRow)Utils.ReadStruct(fs, typeof(MapPlayerPosRow))); _row1To4Player.Add((MapPlayerPosRow)Utils.ReadStruct(fs, typeof(MapPlayerPosRow))); _row1To4Player.Add((MapPlayerPosRow)Utils.ReadStruct(fs, typeof(MapPlayerPosRow))); _row5Monster = (MapMonsterTileRow)Utils.ReadStruct(fs, typeof(MapMonsterTileRow)); _row6MonsterX = (MapMonsterXRow)Utils.ReadStruct(fs, typeof(MapMonsterXRow)); _row7MonsterY = (MapMonsterYRow)Utils.ReadStruct(fs, typeof(MapMonsterYRow)); _row8Trigger = (MapRow)Utils.ReadStruct(fs, typeof(MapRow)); _row9NewTilesX = (MapRow)Utils.ReadStruct(fs, typeof(MapRow)); _row10NewTilesY = (MapRow)Utils.ReadStruct(fs, typeof(MapRow)); fs.Close(); System.Console.WriteLine(""); }
//Init map and hook up buttons. private void InitMap(int height, int width, StreamReader reader = null) { //Wipe the old one first if (m_map != null) { m_map.Destroy(); } m_map = new Map(); for (int y = 0; y < height; y++) { m_map.Rows.Add(new MapRow()); MapRow currentRow = m_map.Rows[y]; for (int x = 0; x < width; x++) { EditorTileButton tile = GameObject.Instantiate(m_tilePrefab).GetComponent <EditorTileButton>(); currentRow.Tiles.Add(tile); SetTilePosition(tile, x, y); tile.transform.parent = m_tileContainer.transform; if (reader != null) { int index = int.Parse(reader.ReadLine()); tile.SetTile(index, m_tileTextures[index]); } else { tile.SetTile((int)EditorDrawMode.DrawEmpty, m_tileTextures[(int)EditorDrawMode.DrawEmpty]); } tile.onClick.AddListener(delegate { TileButtonClicked(); }); } } }
public void RemoveMapRow(MapRow row) { this.Rows.Remove(row); }
public MapRowChangeEvent(MapRow row, System.Data.DataRowAction action) { this.eventRow = row; this.eventAction = action; }
public IPersistable CreateRIFObject(ObjectType objectType, ref IntermediateFormatReader context) { IPersistable persistable = null; if (objectType == ObjectType.Null) { return(null); } IDOwner parentIDOwner = this.m_parentIDOwner; ReportItem parentReportItem = this.m_parentReportItem; switch (objectType) { case ObjectType.PageSection: persistable = new PageSection(this.m_parentReportItem); this.m_parentReportItem = (ReportItem)persistable; break; case ObjectType.Line: persistable = new Line(this.m_parentReportItem); this.m_parentReportItem = (ReportItem)persistable; break; case ObjectType.Rectangle: persistable = new Rectangle(this.m_parentReportItem); this.m_parentReportItem = (ReportItem)persistable; break; case ObjectType.Image: persistable = new Image(this.m_parentReportItem); this.m_parentReportItem = (ReportItem)persistable; break; case ObjectType.TextBox: persistable = new TextBox(this.m_parentReportItem); this.m_parentReportItem = (ReportItem)persistable; break; case ObjectType.SubReport: persistable = new SubReport(this.m_parentReportItem); this.m_parentReportItem = (ReportItem)persistable; break; case ObjectType.Grouping: persistable = new Grouping(ConstructionPhase.Deserializing); break; case ObjectType.Sorting: persistable = new Sorting(ConstructionPhase.Deserializing); break; case ObjectType.ReportItemCollection: persistable = new ReportItemCollection(); break; case ObjectType.ReportItemIndexer: persistable = (IPersistable)(object)default(ReportItemIndexer); break; case ObjectType.Style: persistable = new Style(ConstructionPhase.Deserializing); break; case ObjectType.AttributeInfo: persistable = new AttributeInfo(); break; case ObjectType.Visibility: persistable = new Visibility(); break; case ObjectType.ExpressionInfo: persistable = new ExpressionInfo(); break; case ObjectType.ExpressionInfoTypeValuePair: persistable = new ExpressionInfoTypeValuePair(); break; case ObjectType.DataAggregateInfo: persistable = new DataAggregateInfo(); break; case ObjectType.RunningValueInfo: persistable = new RunningValueInfo(); break; case ObjectType.Filter: persistable = new Filter(); break; case ObjectType.DataSource: persistable = new DataSource(); break; case ObjectType.DataSet: persistable = new DataSet(); break; case ObjectType.ReportQuery: persistable = new ReportQuery(); break; case ObjectType.Field: persistable = new Field(); break; case ObjectType.ParameterValue: persistable = new ParameterValue(); break; case ObjectType.ReportSnapshot: persistable = new ReportSnapshot(); break; case ObjectType.DocumentMapNode: persistable = new DocumentMapNode(); break; case ObjectType.DocumentMapBeginContainer: persistable = DocumentMapBeginContainer.Instance; break; case ObjectType.DocumentMapEndContainer: persistable = DocumentMapEndContainer.Instance; break; case ObjectType.ReportInstance: persistable = new ReportInstance(); break; case ObjectType.ParameterInfo: persistable = new ParameterInfo(); break; case ObjectType.ValidValue: persistable = new ValidValue(); break; case ObjectType.ParameterDataSource: persistable = new ParameterDataSource(); break; case ObjectType.ParameterDef: persistable = new ParameterDef(); break; case ObjectType.ProcessingMessage: persistable = new ProcessingMessage(); break; case ObjectType.CodeClass: persistable = (IPersistable)(object)default(CodeClass); break; case ObjectType.Action: persistable = new Action(); break; case ObjectType.RenderingPagesRanges: persistable = (IPersistable)(object)default(RenderingPagesRanges); break; case ObjectType.IntermediateFormatVersion: persistable = new IntermediateFormatVersion(); break; case ObjectType.ImageInfo: persistable = new ImageInfo(); break; case ObjectType.ActionItem: persistable = new ActionItem(); break; case ObjectType.DataValue: persistable = new DataValue(); break; case ObjectType.CustomReportItem: persistable = new CustomReportItem(this.m_parentReportItem); this.m_parentReportItem = (ReportItem)persistable; break; case ObjectType.SortFilterEventInfoMap: persistable = new SortFilterEventInfoMap(); break; case ObjectType.SortFilterEventInfo: persistable = new SortFilterEventInfo(); break; case ObjectType.EndUserSort: persistable = new EndUserSort(); break; case ObjectType.ScopeLookupTable: persistable = new ScopeLookupTable(); break; case ObjectType.Tablix: persistable = new Tablix(this.m_parentReportItem); this.m_parentReportItem = (ReportItem)persistable; break; case ObjectType.TablixHeader: persistable = new TablixHeader(); break; case ObjectType.TablixMember: persistable = new TablixMember(); break; case ObjectType.TablixColumn: persistable = new TablixColumn(); break; case ObjectType.TablixRow: persistable = new TablixRow(); break; case ObjectType.TablixCornerCell: persistable = new TablixCornerCell(); break; case ObjectType.TablixCell: persistable = new TablixCell(); break; case ObjectType.Chart: persistable = new Chart(this.m_parentReportItem); this.m_parentReportItem = (ReportItem)persistable; break; case ObjectType.ChartMember: persistable = new ChartMember(); break; case ObjectType.ChartSeries: persistable = new ChartSeries(); break; case ObjectType.ChartDataPoint: persistable = new ChartDataPoint(); break; case ObjectType.ChartDataPointValues: persistable = new ChartDataPointValues(); break; case ObjectType.ChartArea: persistable = new ChartArea(); break; case ObjectType.ChartLegend: persistable = new ChartLegend(); break; case ObjectType.ChartLegendTitle: persistable = new ChartLegendTitle(); break; case ObjectType.ChartAxis: persistable = new ChartAxis(); break; case ObjectType.ThreeDProperties: persistable = new ChartThreeDProperties(); break; case ObjectType.ChartDataLabel: persistable = new ChartDataLabel(); break; case ObjectType.ChartMarker: persistable = new ChartMarker(); break; case ObjectType.ChartTitle: persistable = new ChartTitle(); break; case ObjectType.ChartAxisScaleBreak: persistable = new ChartAxisScaleBreak(); break; case ObjectType.ChartDerivedSeries: persistable = new ChartDerivedSeries(); break; case ObjectType.ChartBorderSkin: persistable = new ChartBorderSkin(); break; case ObjectType.ChartNoDataMessage: persistable = new ChartNoDataMessage(); break; case ObjectType.ChartItemInLegend: persistable = new ChartItemInLegend(); break; case ObjectType.ChartEmptyPoints: persistable = new ChartEmptyPoints(); break; case ObjectType.ChartNoMoveDirections: persistable = new ChartNoMoveDirections(); break; case ObjectType.ChartFormulaParameter: persistable = new ChartFormulaParameter(); break; case ObjectType.ChartLegendColumn: persistable = new ChartLegendColumn(); break; case ObjectType.ChartLegendColumnHeader: persistable = new ChartLegendColumnHeader(); break; case ObjectType.ChartLegendCustomItem: persistable = new ChartLegendCustomItem(); break; case ObjectType.ChartLegendCustomItemCell: persistable = new ChartLegendCustomItemCell(); break; case ObjectType.ChartAlignType: persistable = new ChartAlignType(); break; case ObjectType.ChartElementPosition: persistable = new ChartElementPosition(); break; case ObjectType.ChartSmartLabel: persistable = new ChartSmartLabel(); break; case ObjectType.ChartStripLine: persistable = new ChartStripLine(); break; case ObjectType.ChartAxisTitle: persistable = new ChartAxisTitle(); break; case ObjectType.ChartCustomPaletteColor: persistable = new ChartCustomPaletteColor(); break; case ObjectType.GridLines: persistable = new ChartGridLines(); break; case ObjectType.ChartTickMarks: persistable = new ChartTickMarks(); break; case ObjectType.DataMember: persistable = new DataMember(); break; case ObjectType.CustomDataRow: persistable = new CustomDataRow(); break; case ObjectType.DataCell: persistable = new DataCell(); break; case ObjectType.Variable: persistable = new Variable(); break; case ObjectType.Page: persistable = new Page(); break; case ObjectType.Paragraph: persistable = new Paragraph(); break; case ObjectType.TextRun: persistable = new TextRun(); break; case ObjectType.Report: persistable = new Report(this.m_parentReportItem); this.m_parentReportItem = (ReportItem)persistable; break; case ObjectType.GaugePanel: persistable = new GaugePanel(this.m_parentReportItem); this.m_parentReportItem = (ReportItem)persistable; break; case ObjectType.GaugeMember: persistable = new GaugeMember(); break; case ObjectType.GaugeRow: persistable = new GaugeRow(); break; case ObjectType.GaugeCell: persistable = new GaugeCell(); break; case ObjectType.BackFrame: persistable = new BackFrame(); break; case ObjectType.CapImage: persistable = new CapImage(); break; case ObjectType.FrameBackground: persistable = new FrameBackground(); break; case ObjectType.FrameImage: persistable = new FrameImage(); break; case ObjectType.CustomLabel: persistable = new CustomLabel(); break; case ObjectType.GaugeImage: persistable = new GaugeImage(); break; case ObjectType.GaugeInputValue: persistable = new GaugeInputValue(); break; case ObjectType.GaugeLabel: persistable = new GaugeLabel(); break; case ObjectType.GaugePanelItem: persistable = new GaugePanelItem(); break; case ObjectType.GaugeTickMarks: persistable = new GaugeTickMarks(); break; case ObjectType.LinearGauge: persistable = new LinearGauge(); break; case ObjectType.LinearPointer: persistable = new LinearPointer(); break; case ObjectType.LinearScale: persistable = new LinearScale(); break; case ObjectType.NumericIndicator: persistable = new NumericIndicator(); break; case ObjectType.PinLabel: persistable = new PinLabel(); break; case ObjectType.PointerCap: persistable = new PointerCap(); break; case ObjectType.PointerImage: persistable = new PointerImage(); break; case ObjectType.RadialGauge: persistable = new RadialGauge(); break; case ObjectType.RadialPointer: persistable = new RadialPointer(); break; case ObjectType.RadialScale: persistable = new RadialScale(); break; case ObjectType.ScaleLabels: persistable = new ScaleLabels(); break; case ObjectType.ScalePin: persistable = new ScalePin(); break; case ObjectType.ScaleRange: persistable = new ScaleRange(); break; case ObjectType.IndicatorImage: persistable = new IndicatorImage(); break; case ObjectType.StateIndicator: persistable = new StateIndicator(); break; case ObjectType.Thermometer: persistable = new Thermometer(); break; case ObjectType.TickMarkStyle: persistable = new TickMarkStyle(); break; case ObjectType.TopImage: persistable = new TopImage(); break; case ObjectType.LookupInfo: persistable = new LookupInfo(); break; case ObjectType.LookupDestinationInfo: persistable = new LookupDestinationInfo(); break; case ObjectType.ReportSection: persistable = new ReportSection(); break; case ObjectType.MapFieldDefinition: persistable = new MapFieldDefinition(); break; case ObjectType.MapFieldName: persistable = new MapFieldName(); break; case ObjectType.MapLineLayer: persistable = new MapLineLayer(); break; case ObjectType.MapShapefile: persistable = new MapShapefile(); break; case ObjectType.MapPolygonLayer: persistable = new MapPolygonLayer(); break; case ObjectType.MapSpatialDataRegion: persistable = new MapSpatialDataRegion(); break; case ObjectType.MapSpatialDataSet: persistable = new MapSpatialDataSet(); break; case ObjectType.MapPointLayer: persistable = new MapPointLayer(); break; case ObjectType.MapTile: persistable = new MapTile(); break; case ObjectType.MapTileLayer: persistable = new MapTileLayer(); break; case ObjectType.MapField: persistable = new MapField(); break; case ObjectType.MapLine: persistable = new MapLine(); break; case ObjectType.MapPolygon: persistable = new MapPolygon(); break; case ObjectType.MapPoint: persistable = new MapPoint(); break; case ObjectType.MapLineTemplate: persistable = new MapLineTemplate(); break; case ObjectType.MapPolygonTemplate: persistable = new MapPolygonTemplate(); break; case ObjectType.MapMarkerTemplate: persistable = new MapMarkerTemplate(); break; case ObjectType.Map: persistable = new Map(this.m_parentReportItem); this.m_parentReportItem = (ReportItem)persistable; break; case ObjectType.MapBorderSkin: persistable = new MapBorderSkin(); break; case ObjectType.MapDataRegion: persistable = new MapDataRegion(this.m_parentReportItem); break; case ObjectType.MapMember: persistable = new MapMember(); break; case ObjectType.MapRow: persistable = new MapRow(); break; case ObjectType.MapCell: persistable = new MapCell(); break; case ObjectType.MapLocation: persistable = new MapLocation(); break; case ObjectType.MapSize: persistable = new MapSize(); break; case ObjectType.MapGridLines: persistable = new MapGridLines(); break; case ObjectType.MapBindingFieldPair: persistable = new MapBindingFieldPair(); break; case ObjectType.MapCustomView: persistable = new MapCustomView(); break; case ObjectType.MapDataBoundView: persistable = new MapDataBoundView(); break; case ObjectType.MapElementView: persistable = new MapElementView(); break; case ObjectType.MapViewport: persistable = new MapViewport(); break; case ObjectType.MapLimits: persistable = new MapLimits(); break; case ObjectType.MapColorScale: persistable = new MapColorScale(); break; case ObjectType.MapColorScaleTitle: persistable = new MapColorScaleTitle(); break; case ObjectType.MapDistanceScale: persistable = new MapDistanceScale(); break; case ObjectType.MapTitle: persistable = new MapTitle(); break; case ObjectType.MapLegend: persistable = new MapLegend(); break; case ObjectType.MapLegendTitle: persistable = new MapLegendTitle(); break; case ObjectType.MapBucket: persistable = new MapBucket(); break; case ObjectType.MapColorPaletteRule: persistable = new MapColorPaletteRule(); break; case ObjectType.MapColorRangeRule: persistable = new MapColorRangeRule(); break; case ObjectType.MapCustomColorRule: persistable = new MapCustomColorRule(); break; case ObjectType.MapCustomColor: persistable = new MapCustomColor(); break; case ObjectType.MapLineRules: persistable = new MapLineRules(); break; case ObjectType.MapPolygonRules: persistable = new MapPolygonRules(); break; case ObjectType.MapSizeRule: persistable = new MapSizeRule(); break; case ObjectType.MapMarkerImage: persistable = new MapMarkerImage(); break; case ObjectType.MapMarker: persistable = new MapMarker(); break; case ObjectType.MapMarkerRule: persistable = new MapMarkerRule(); break; case ObjectType.MapPointRules: persistable = new MapPointRules(); break; case ObjectType.PageBreak: persistable = new PageBreak(); break; case ObjectType.DataScopeInfo: persistable = new DataScopeInfo(); break; case ObjectType.LinearJoinInfo: persistable = new LinearJoinInfo(); break; case ObjectType.IntersectJoinInfo: persistable = new IntersectJoinInfo(); break; case ObjectType.BucketedDataAggregateInfos: persistable = new BucketedDataAggregateInfos(); break; case ObjectType.DataAggregateInfoBucket: persistable = new DataAggregateInfoBucket(); break; case ObjectType.NumericIndicatorRange: persistable = new NumericIndicatorRange(); break; case ObjectType.IndicatorState: persistable = new IndicatorState(); break; case ObjectType.SharedDataSetQuery: persistable = new SharedDataSetQuery(); break; case ObjectType.DataSetCore: persistable = new DataSetCore(); break; case ObjectType.DataSetParameterValue: persistable = new DataSetParameterValue(); break; case ObjectType.RIFVariantContainer: persistable = new RIFVariantContainer(); break; case ObjectType.IdcRelationship: persistable = new IdcRelationship(); break; case ObjectType.DefaultRelationship: persistable = new DefaultRelationship(); break; case ObjectType.JoinCondition: persistable = new Relationship.JoinCondition(); break; case ObjectType.BandLayoutOptions: persistable = new BandLayoutOptions(); break; case ObjectType.LabelData: persistable = new LabelData(); break; case ObjectType.Slider: persistable = new Slider(); break; case ObjectType.Coverflow: persistable = new Coverflow(); break; case ObjectType.PlayAxis: persistable = new PlayAxis(); break; case ObjectType.BandNavigationCell: persistable = new BandNavigationCell(); break; case ObjectType.Tabstrip: persistable = new Tabstrip(); break; case ObjectType.NavigationItem: persistable = new NavigationItem(); break; case ObjectType.ScopedFieldInfo: persistable = new ScopedFieldInfo(); break; default: Global.Tracer.Assert(false, "Unsupported object type: " + objectType.ToString()); break; } IDOwner iDOwner = persistable as IDOwner; if (iDOwner != null) { iDOwner.ParentInstancePath = this.m_parentIDOwner; this.m_parentIDOwner = iDOwner; } persistable.Deserialize(context); this.m_parentIDOwner = parentIDOwner; this.m_parentReportItem = parentReportItem; return(persistable); }
public void AddMapRow(MapRow row) { this.Rows.Add(row); }
public TileMap(Texture2D mouseMap, Texture2D tileHighligter) { _rnd = new Random(); _mouseMap = mouseMap; _tileHighligter = tileHighligter; const int maxdepth = ((MapWidth + 1) + ((MapHeight + 1) * Tile.TileWidth)) * 10; DepthCalculator.Initialize(maxdepth); for (int y = 0; y < MapHeight; y++) { var thisRow = new MapRow(); for (int x = 0; x < MapWidth; x++) { thisRow.Columns.Add(new MapCell(_rnd.Next(0,7))); } _rows.Add(thisRow); } // Create Sample Map Data _rows[3].Columns[2 + 7].TileID = 3; _rows[3].Columns[3 + 7].TileID = 1; _rows[3].Columns[4 + 7].TileID = 1; _rows[3].Columns[5 + 7].TileID = 2; _rows[3].Columns[6 + 7].TileID = 2; _rows[3].Columns[7 + 7].TileID = 2; _rows[4].Columns[2 + 7].TileID = 3; _rows[4].Columns[3 + 7].TileID = 1; _rows[4].Columns[4 + 7].TileID = 1; _rows[4].Columns[5 + 7].TileID = 2; _rows[4].Columns[6 + 7].TileID = 2; _rows[4].Columns[7 + 7].TileID = 2; _rows[5].Columns[2 + 7].TileID = 3; _rows[5].Columns[3 + 7].TileID = 1; _rows[5].Columns[4 + 7].TileID = 1; _rows[5].Columns[5 + 7].TileID = 2; _rows[5].Columns[6 + 7].TileID = 2; _rows[5].Columns[7 + 7].TileID = 2; _rows[4].Columns[6 + 7].AddBaseTile(104); _rows[16].Columns[4 + 7].AddHeightTile(54); _rows[17].Columns[3 + 7].AddHeightTile(54); _rows[15].Columns[3 + 7].AddHeightTile(54); _rows[16].Columns[3 + 7].AddHeightTile(53); _rows[15].Columns[4 + 7].AddHeightTile(54); _rows[15].Columns[4 + 7].AddHeightTile(54); _rows[15].Columns[4 + 7].AddHeightTile(51); _rows[18].Columns[3 + 7].AddHeightTile(51); _rows[19].Columns[3 + 7].AddHeightTile(50); _rows[18].Columns[4 + 7].AddHeightTile(55); _rows[14].Columns[4 + 7].AddHeightTile(54); _rows[14].Columns[5 + 7].AddHeightTile(62); _rows[14].Columns[5 + 7].AddHeightTile(61); _rows[14].Columns[5 + 7].AddHeightTile(63); _rows[17].Columns[4 + 7].AddTopperTile(114); _rows[16].Columns[5 + 7].AddTopperTile(115); _rows[14].Columns[4 + 7].AddTopperTile(125); _rows[15].Columns[5 + 7].AddTopperTile(91); _rows[16].Columns[6 + 7].AddTopperTile(94); #region holes RemoveRow(11, 30, 0, ref _rows); _rows[34].Columns[12] = null; RemoveRow(35, 44, 12, ref _rows); RemoveRow(13, 31, 0, ref _rows); RemoveRow(35, 44, 11, ref _rows); RemoveRow(15, 32, 0, ref _rows); RemoveRow(37, 44, 11, ref _rows); RemoveRow(37, 44, 10, ref _rows); RemoveRow(38, 44, 10, ref _rows); _rows[36].Columns[11] = null; _rows[10].Columns[0] = null; _rows[12].Columns[0] = null; _rows[14].Columns[0] = null; #endregion // End Create Sample Map Data }
private void BuildGrid(string logicalName) { gridMap.DataSource = null; gridMap.AutoGenerateColumns = false; if (tabSample.Parent == tabGrpMain) { tabGrpHidden.TabPages.Add(tabSample); } List <string> mapsNotFound = new List <string>(); string primaryFieldLabel = "Primary Name Column: "; var saveMap = cboSelectSaved.SelectedItem == null ? null : mySettings.Settings.First(stng => stng.Name == cboSelectSaved.SelectedItem.ToString()); WorkAsync(new WorkAsyncInfo { Message = "Retrieving Attributes...", Work = (w, e) => { var entityMeta = Service.GetEntityMetadata(logicalName);// entitiesDD.SelectedEntity.LogicalName); var primaryField = entityMeta.Attributes.First(at => at.LogicalName == entityMeta.PrimaryNameAttribute) as StringAttributeMetadata; primaryFieldLabel += primaryField.DisplayName.UserLocalizedLabel == null ? primaryField.LogicalName : primaryField.DisplayName.UserLocalizedLabel.Label + " ( " + primaryField.LogicalName + " ) "; if (!string.IsNullOrEmpty(primaryField.FormulaDefinition)) { primaryFieldLabel += " Formula: " + primaryField.FormulaDefinition; } SortableBindingList <MapRow> attributes = new SortableBindingList <MapRow>(); w.ReportProgress(50, "Got Attributes"); foreach (var field in entityMeta.Attributes.Where(fld => !notPermitted.Any(np => np == fld.AttributeType)).Where(fld => fld.IsValidForCreate == true && (!mySettings.ExcludeConfig.ImportSeqNo || fld.LogicalName != "importsequencenumber") && (mySettings.ExcludeConfig.DeprecatedColumns ? (!fld.DisplayName.LocalizedLabels.Any() || fld.DisplayName.LocalizedLabels.Any(lbl => !lbl.Label.ToLower().Contains("deprecated"))) : true) )) { var mapRow = new MapRow(field); mapRow.PropertyChanged += MapRow_PropertyChanged; attributes.Add(mapRow); } w.ReportProgress(100, "Loading Grid"); e.Result = attributes; }, ProgressChanged = e => SetWorkingMessage(e.UserState.ToString()), PostWorkCallBack = e => { gridMap.DataSource = e.Result; SetUpColumns(); //ColourPrimaryNameField(e.Result as SortableBindingList<MapRow>); lblPrimary.Text = primaryFieldLabel; LogInfo(DateTime.UtcNow + " | Start with SavedMaps"); if (saveMap != null) { var attributes = gridMap.DataSource as SortableBindingList <MapRow>; foreach (var map in saveMap.MapRows) { if (attributes.Any(mr => mr.AttributeName == map.AttributeName)) { // #5 If no mocks in the save, don't bother doing anything if (map.SelectedMock.Count > 0) { var mapRow = attributes.First(mr => mr.AttributeName == map.AttributeName); AddOptions(mapRow); var mockType = map.SelectedMock.First(kvp => kvp.Key == "MockName").Value.ToString(); var mockOption = mapRow.MockOptions.Mocks.FirstOrDefault(m => m.Name == mockType); if (mockOption != null) { selectedMaps.Add(mapRow); mapRow.PropertyChanged -= MapRow_PropertyChanged; LogInfo(DateTime.UtcNow + " | Pre Select Change"); mapRow.Selected = true; LogInfo(DateTime.UtcNow + " | Pre mocktype change"); mapRow.MockType = mockType; mapRow.SelectedMock = mockOption.Clone(); LogInfo(DateTime.UtcNow + " | Pre KVPPopulate"); Populate(mapRow.Attribute, mapRow.SelectedMock, true); //PopulateLookup(mapRow.Attribute, mapRow.SelectedMock); //PopulatePickList(mapRow.Attribute, mapRow.SelectedMock); //PopulateSet(mapRow.Attribute, mapRow.SelectedMock); mapRow.SelectedMock.PopulateFromKVP(map.SelectedMock); LogInfo(DateTime.UtcNow + " | post KVPPopulate"); gridMap.Rows.Cast <DataGridViewRow>().Where(mr => mr.DataBoundItem == mapRow).First().Cells["Config"].ReadOnly = mapRow.AdditionalProperties == string.Empty; gridMap.Rows.Cast <DataGridViewRow>().Where(mr => mr.DataBoundItem == mapRow).First().Cells[percBlank].ReadOnly = mapRow.SelectedMock.Fixed; //SetUpNumberDefaults(mapRow.Attribute, mapRow.SelectedMock); mapRow.PropertyChanged += MapRow_PropertyChanged; } } } else { mapsNotFound.Add(map.AttributeName); } } } if (mapsNotFound.Count > 0) { MessageBox.Show("These attributes could not be found\r\n" + string.Join("\r\n", mapsNotFound.ToArray()) + "\r\nPlease ensure mapping still valid", "Not all maps found", MessageBoxButtons.OK); } gridMap.AutoResizeColumns(); gridMap.Sort(gridMap.Columns[1], ListSortDirection.Ascending); LogInfo(DateTime.UtcNow + " | Ended with SavedMaps"); } }); }
public MapPosition(MapRow mapRow, int rowPosition) { _row = mapRow; _rowPosition = rowPosition; }
private readonly SpriteFont _tileIndexer; //for debug tiles. #endregion Fields #region Constructors public TileMap(Texture2D mouseMap, SpriteFont tileIndexer, Texture2D tileHighligter) { _rnd = new Random(); _mouseMap = mouseMap; _tileIndexer = tileIndexer; _tileHighligter = tileHighligter; _maxdepth = ((MapWidth + 1) + ((MapHeight + 1) * Tile.TileWidth)) * 10; for (int y = 0; y < MapHeight; y++) { var thisRow = new MapRow(); for (int x = 0; x < MapWidth; x++) { thisRow.Columns.Add(new MapCell(_rnd.Next(0,7))); } _rows.Add(thisRow); } // Create Sample Map Data _rows[3].Columns[2].TileID = 3; _rows[3].Columns[3].TileID = 1; _rows[3].Columns[4].TileID = 1; _rows[3].Columns[5].TileID = 2; _rows[3].Columns[6].TileID = 2; _rows[3].Columns[7].TileID = 2; _rows[4].Columns[2].TileID = 3; _rows[4].Columns[3].TileID = 1; _rows[4].Columns[4].TileID = 1; _rows[4].Columns[5].TileID = 2; _rows[4].Columns[6].TileID = 2; _rows[4].Columns[7].TileID = 2; _rows[5].Columns[2].TileID = 3; _rows[5].Columns[3].TileID = 1; _rows[5].Columns[4].TileID = 1; _rows[5].Columns[5].TileID = 2; _rows[5].Columns[6].TileID = 2; _rows[5].Columns[7].TileID = 2; _rows[3].Columns[5].AddBaseTile(30); _rows[4].Columns[5].AddBaseTile(27); _rows[5].Columns[5].AddBaseTile(28); _rows[3].Columns[6].AddBaseTile(25); _rows[5].Columns[6].AddBaseTile(24); _rows[3].Columns[7].AddBaseTile(31); _rows[4].Columns[7].AddBaseTile(26); _rows[5].Columns[7].AddBaseTile(29); _rows[4].Columns[6].AddBaseTile(104); _rows[16].Columns[4].AddHeightTile(54); _rows[17].Columns[3].AddHeightTile(54); _rows[15].Columns[3].AddHeightTile(54); _rows[16].Columns[3].AddHeightTile(53); _rows[15].Columns[4].AddHeightTile(54); _rows[15].Columns[4].AddHeightTile(54); _rows[15].Columns[4].AddHeightTile(51); _rows[18].Columns[3].AddHeightTile(51); _rows[19].Columns[3].AddHeightTile(50); _rows[18].Columns[4].AddHeightTile(55); _rows[14].Columns[4].AddHeightTile(54); _rows[14].Columns[5].AddHeightTile(62); _rows[14].Columns[5].AddHeightTile(61); _rows[14].Columns[5].AddHeightTile(63); _rows[17].Columns[4].AddTopperTile(114); _rows[16].Columns[5].AddTopperTile(115); _rows[14].Columns[4].AddTopperTile(125); _rows[15].Columns[5].AddTopperTile(91); _rows[16].Columns[6].AddTopperTile(94); _rows[12].Columns[9].AddHeightTile(34); _rows[11].Columns[9].AddHeightTile(34); _rows[11].Columns[8].AddHeightTile(34); _rows[10].Columns[9].AddHeightTile(34); _rows[12].Columns[8].AddTopperTile(31); _rows[13].Columns[8].AddTopperTile(31); _rows[12].Columns[10].AddTopperTile(32); _rows[13].Columns[9].AddTopperTile(32); _rows[14].Columns[9].AddTopperTile(30); // End Create Sample Map Data }
public ConfigEdit(MapRow row, IOrganizationService service) { mapRow = row; InitializeComponent(); Service = service; }
public void Add(MapRow row) { rows.Add(row); }