public RowObject(int y, int width, CellObject template) { rownum = y; // used to give objects in inspector a name GameObject holder = new GameObject(); holder.name = "row " + y; // add cells to RowObject and Instantiate them in game for (int x = 0; x < width; x++) { CellObject newCell = Instantiate(template, Vector3.zero, Quaternion.identity) as CellObject; // store grid pos in CellObject newCell.pos = new Vector2(x, y); newCell.transform.position = new Vector3(x, y, 0); // make holder parent of newCell to organize scene list newCell.transform.parent = holder.transform; row.Add(newCell); } }
void options_CustomizeSheetFooter(ContextEventArgs e) { // Add an empty row to the document's footer. e.ExportContext.AddRow(); // Create a new row. var firstRow = new CellObject(); // Specify row values. firstRow.Value = @"The report is generated from the NorthWind database."; // Specify the cell content alignment and font settings. var rowFormatting = CreateXlFormattingObject(true, 18); rowFormatting.Alignment.HorizontalAlignment = XlHorizontalAlignment.Left; firstRow.Formatting = rowFormatting; // Add the created row to the output document. e.ExportContext.AddRow(new[] { firstRow }); // Create one more row. var secondRow = new CellObject(); // Specify the row value. secondRow.Value = @"The addresses and phone numbers are fictitious."; // Change the row's font settings. rowFormatting.Font.Size = 14; rowFormatting.Font.Bold = false; rowFormatting.Font.Italic = true; secondRow.Formatting = rowFormatting; // Add this row to the output document. e.ExportContext.AddRow(new[] { secondRow }); }
//弹出 private void WindowsList_MouseUp(object sender, MouseEventArgs e) { isMove = 0; move_form = null; this.x = e.X; this.e_x = e.X; foreach (CellObject obj in lstobj) { if (obj.r.Contains(e.X, e.Y) == true) { if (obj.type == 2) { var form = (Form)obj.data; form.Close(); } else if (obj.type == 1) { var form = (Form)obj.data; this.ShowForm(form); } break; } } }
// 0 is no collision. 1 is collision. 2 is left wall collision, 3 is right wall collision int CheckCollision(List <Vector2> newpoints) { foreach (Vector2 point in newpoints) { CellObject testcell = getCellAtPos(point); if (testcell == null) { if (point.y >= 0) { if (point.x < 0) { return(2); } else { return(3); } } else { return(1); } } if (testcell.occupied) { return(1); } } return(0); }
Tetromino SpawnBlock() { Tetromino activeblock = blockmanager.getRandomBlock(); // spawn location is 5, height - 3 CellObject spawncell = getCellAtPos(new Vector2(5, height - 3)); spawncell.changeColor(activeblock.BlockColor); // update origin in Tetromino activeblock.origin = spawncell.pos; // update positions, get appropiate cell, set color for (int i = 0; i < 3; i++) { activeblock.points[i] += activeblock.origin; CellObject cell = getCellAtPos(activeblock.points[i]); if (cell != null) { cell.changeColor(activeblock.BlockColor); } } return(activeblock); }
public bool Switch() { CellObject firstCellObject = FirstCell.ContainedObject; CellObject secondCellObject = SecondCell.ContainedObject; if (firstCellObject == null || secondCellObject == null) { Debug.LogWarning("One of cells is empty. Abort"); return(false); } if (firstCellObject.InAction || secondCellObject.InAction) { Debug.LogWarning("One of objects in action now. Abort"); return(false); } firstCellObject.OnMoveEnd += OnMoveEnd; secondCellObject.OnMoveEnd += OnMoveEnd; _switchCounter = 2; firstCellObject.MoveTo(SecondCell); secondCellObject.MoveTo(FirstCell); secondCellObject.SetParentCell(FirstCell); firstCellObject.SetParentCell(SecondCell); return(true); }
public bool TryGetReferenceCell(Vector2Int coords, out CellObject referenceCell) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) IMapDefinition mapDefinition = m_mapDefinition; int cellIndex = mapDefinition.GetCellIndex(coords.get_x(), coords.get_y()); Cell cell = m_virtualCells[cellIndex]; Area area = cell.area; if (area == null) { referenceCell = cell.cellObject; return(true); } Vector2Int refCoord = area.refCoord; if (refCoord == coords) { cellIndex = mapDefinition.GetCellIndex(refCoord.get_x(), refCoord.get_y()); referenceCell = m_virtualCells[cellIndex].cellObject; return(true); } referenceCell = null; return(false); }
private void AddChildren(Excel.Range poppedExcelCell, ref Stack <Excel.Range> stackExcelCells) { CellObject poppedCell = PopulateCellObjectMetadata(poppedExcelCell); GetCellObjectReference(ref poppedCell); if (CheckDepthLimit(poppedCell) == false) { return; } _treeGeneratorViewModel.UpdateStatus(string.Format("Now processing: '{0}'. Getting {1}...", poppedCell.Name, _mode)); List <Excel.Range> excelChildrenOfPoppedCell = GetChildren(ref poppedExcelCell, ref stackExcelCells); if (excelChildrenOfPoppedCell != null) { _treeGeneratorViewModel.UpdateStatus(string.Format("'{0}' has {1} {2}", poppedCell.Name, excelChildrenOfPoppedCell.Count, _mode)); if (excelChildrenOfPoppedCell.Count > 0) { AddChildrenToTree(poppedCell, excelChildrenOfPoppedCell); } } }
// change what cells a Tetromino appears in from previous coords to newpoints void UpdateCells(Tetromino activeblock, List <Vector2> newpoints) { List <CellObject> newCells = new List <CellObject>(); foreach (Vector2 point in activeblock.GetAllPoints()) { CellObject cell = getCellAtPos(point); if (cell != null) { cell.changeColor(Color.white); } } foreach (Vector2 point in newpoints) { newCells.Add(getCellAtPos(point)); } foreach (CellObject newcell in newCells) { if (newcell != null) { newcell.changeColor(activeblock.BlockColor); } } }
void options_CustomizeSheetHeader(DevExpress.Export.ContextEventArgs e) { // Create a new row. CellObject row = new CellObject(); XlFormattingObject rowFormatting = new XlFormattingObject(); // Specify row values. row.Value = "CORTE ALQUILER"; rowFormatting.Font = new XlCellFont { Bold = true, Size = 14 }; rowFormatting.BackColor = Color.Orange; rowFormatting.Alignment = new DevExpress.Export.Xl.XlCellAlignment { HorizontalAlignment = DevExpress.Export.Xl.XlHorizontalAlignment.Center, VerticalAlignment = DevExpress.Export.Xl.XlVerticalAlignment.Top }; row.Formatting = rowFormatting; // Add the created row to the output document. e.ExportContext.AddRow(new[] { row }); // Add an empty row to the output document. e.ExportContext.AddRow(); // Merge cells of two new rows. if (idArea == idAreaComercialSupervisor) { e.ExportContext.MergeCells(new DevExpress.Export.Xl.XlCellRange(new DevExpress.Export.Xl.XlCellPosition(0, 0), new DevExpress.Export.Xl.XlCellPosition(9, 1))); //EL 6 SON LAS COLUMNAS QUE TIENE EL REPORTE } else { e.ExportContext.MergeCells(new DevExpress.Export.Xl.XlCellRange(new DevExpress.Export.Xl.XlCellPosition(0, 0), new DevExpress.Export.Xl.XlCellPosition(8, 1))); //EL 6 SON LAS COLUMNAS QUE TIENE EL REPORTE } }
protected void Create() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) IMapDefinition mapDefinition = m_mapDefinition; Vector2Int val = mapDefinition.sizeMax - mapDefinition.sizeMin; m_cellObjectsByIndex = new CellObject[val.get_x() * val.get_y()]; int num = m_cellObjects.Length; for (int i = 0; i < num; i++) { CellObject cellObject = m_cellObjects[i]; Vector2Int coords = cellObject.coords; int cellIndex = mapDefinition.GetCellIndex(coords.get_x(), coords.get_y()); m_cellObjectsByIndex[cellIndex] = cellObject; cellObject.Initialize(this); } m_virtualGrid = new MapVirtualGrid(mapDefinition, m_cellObjects); CreateCellHighlights(); }
public unsafe virtual bool TryGetCellObject(int x, int y, out CellObject cellObject) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) IMapDefinition mapDefinition = m_mapDefinition; Vector2 val = Vector2Int.op_Implicit(mapDefinition.sizeMin); if ((float)x < ((IntPtr)(void *)val).x || (float)y < ((IntPtr)(void *)val).y) { cellObject = null; return(false); } Vector2 val2 = Vector2Int.op_Implicit(mapDefinition.sizeMax); if ((float)x >= ((IntPtr)(void *)val2).x || (float)y >= ((IntPtr)(void *)val2).y) { cellObject = null; return(false); } int cellIndex = mapDefinition.GetCellIndex(x, y); cellObject = m_cellObjectsByIndex[cellIndex]; return(null != cellObject); }
private bool CheckDepthLimit(CellObject cellObject) { int currentDepth = 0; CellObject clonedObject = CloneExtensions.CloneFactory.GetClone(cellObject); while (true) { CellObject parent = clonedObject.Parent; if (parent == null) { break; } currentDepth++; clonedObject = parent; } if (currentDepth >= _maxDepth) { _treeGeneratorViewModel.UpdateStatus(string.Format("Max Allowed Depth {0} Reached for {1}. Detected depth: {2} NOTE: Won't process it's {3}", _maxDepth, cellObject.Name, currentDepth, _mode)); _incompleteProcessing = true; return(false); } return(true); }
private void AddChildrenToTree(CellObject poppedCell, List <Excel.Range> excelChildrenOfPoppedCell) { CellObject cellObjOfGlobalCollection; foreach (Excel.Range excelChild in excelChildrenOfPoppedCell) { CellObject child = PopulateCellObjectMetadata(excelChild); if (_allWorkBookCellObjects.TryGetValue(child.Name, out cellObjOfGlobalCollection)) { child = cellObjOfGlobalCollection; if (!poppedCell.Children.Contains(child)) { poppedCell.Children.Add(child); } } else { _allWorkBookCellObjects.Add(child.Name, child); poppedCell.Children.Add(child); } child.Parent = poppedCell; _totalNodesInTree++; } }
public void GetAreaCellsNoAlloc(Vector2Int coords, List <CellObject> outCells) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) IMapDefinition mapDefinition = m_mapDefinition; int cellIndex = mapDefinition.GetCellIndex(coords.get_x(), coords.get_y()); Cell cell = m_virtualCells[cellIndex]; Area area = cell.area; if (area == null) { CellObject cellObject = cell.cellObject; if (null != cellObject) { outCells.Add(cellObject); } return; } Vector2Int[] occupiedCoords = area.occupiedCoords; int num = occupiedCoords.Length; for (int i = 0; i < num; i++) { Vector2Int val = occupiedCoords[i]; cellIndex = mapDefinition.GetCellIndex(val.get_x(), val.get_y()); outCells.Add(m_virtualCells[cellIndex].cellObject); } }
public void UnpinCellObject() { if (ContainedObject == null) { return; } ContainedObject = null; }
public static IEnumerator ShowPlayingSpell(SpellStatus spellStatus, CellObject cell) { PlaySpellCompanionUI playSpellCompanionUI = s_instance.m_playSpellCompanionUI; if (null != playSpellCompanionUI) { yield return(playSpellCompanionUI.ShowPlaying(spellStatus, cell)); } }
public void Clear() { if (ContainedObject == null) { return; } Destroy(ContainedObject.gameObject); ContainedObject = null; }
public static IEnumerator PlayGenericEffect(SpellEffectKey key, int fightId, int?parentEventId, [NotNull] IsoObject target, [CanBeNull] FightContext fightContext) { if (s_spellEffectCache == null || s_currentSpellEffectOverrideData == null) { Log.Error("PlayGenericEffect called while the factory is not ready.", 290, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightSpellEffectFactory.cs"); } else { if (((!parentEventId.HasValue || !s_currentSpellEffectOverrideData[fightId].TryGetSpellEffectOverride(key, parentEventId.Value, out SpellEffect value)) && !s_spellEffectCache.TryGetValue(key, out value)) || null == value) { yield break; } CellObject cellObject = target.cellObject; if (null == cellObject) { Log.Warning($"Tried to play generic effect {key} on target named {target.get_name()} ({((object)target).GetType().Name}) but the target is no longer on the board.", 313, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightSpellEffectFactory.cs"); yield break; } Transform transform = cellObject.get_transform(); Quaternion rotation = Quaternion.get_identity(); Vector3 scale = Vector3.get_one(); ITimelineContextProvider timelineContextProvider = target as ITimelineContextProvider; switch (value.orientationMethod) { case SpellEffect.OrientationMethod.None: { CameraHandler current = CameraHandler.current; if (null != current) { rotation = current.mapRotation.GetInverseRotation(); } break; } case SpellEffect.OrientationMethod.Context: { VisualEffectContext visualEffectContext; if (timelineContextProvider != null && (visualEffectContext = (timelineContextProvider.GetTimelineContext() as VisualEffectContext)) != null) { visualEffectContext.GetVisualEffectTransformation(out rotation, out scale); } break; } case SpellEffect.OrientationMethod.SpellEffectTarget: Log.Warning($"Spell effect named '{value.get_name()}' orientation method is {SpellEffect.OrientationMethod.SpellEffectTarget} but is not played from a spell.", 346, "C:\\BuildAgents\\AgentB\\work\\cub_client_win64_develop\\client\\DofusCube.Unity\\Assets\\Core\\Code\\Fight\\FightSpellEffectFactory.cs"); break; default: throw new ArgumentOutOfRangeException(); } yield return(PlaySpellEffect(value, transform, rotation, scale, 0f, fightContext, timelineContextProvider)); } }
private void CellObject_OnHideEnd(CellObject cellObject) { if (ContainedObject != null) { ContainedObject.OnHideEnd -= CellObject_OnHideEnd; } if (OnCollectEnd != null) { OnCollectEnd(this); } }
public unsafe IEnumerator AddMonsterSpawnCell(int x, int y, Direction direction) { MonsterSpawnCellDefinition monsterSpawnCellDefinition = m_bossFightMapResources.monsterSpawnCellDefinition; if (null == monsterSpawnCellDefinition) { yield break; } IMapDefinition mapDefinition = m_mapDefinition; Vector2 val = Vector2Int.op_Implicit(mapDefinition.sizeMin); if ((float)x < ((IntPtr)(void *)val).x || (float)y < ((IntPtr)(void *)val).y) { yield break; } Vector2 val2 = Vector2Int.op_Implicit(mapDefinition.sizeMax); if ((float)x >= ((IntPtr)(void *)val2).x || (float)y >= ((IntPtr)(void *)val2).y) { yield break; } int index = mapDefinition.GetCellIndex(x, y); CellObject cellObject = m_cellObjectsByIndex[index]; Transform transform = cellObject.get_transform(); Vector3 position = transform.get_position() + 0.5f * Vector3.get_up(); Quaternion rotation = Quaternion.get_identity(); if (AudioManager.isReady) { AudioReference appearanceSound = monsterSpawnCellDefinition.appearanceSound; if (appearanceSound.get_isValid()) { AudioManager.PlayOneShot(appearanceSound, transform); } } VisualEffect appearanceEffect = monsterSpawnCellDefinition.appearanceEffect; if (null != appearanceEffect) { Object.Instantiate <VisualEffect>(appearanceEffect, position, rotation, transform); float appearanceDelay = monsterSpawnCellDefinition.appearanceDelay; if (appearanceDelay > 0f) { yield return((object)new WaitForTime(appearanceDelay)); } } GameObject val3 = monsterSpawnCellDefinition.Instantiate(position, rotation, cellObject.get_transform()); if (!(null == val3)) { val3.GetComponent <SpawnCellObject>().SetDirection(direction); m_monsterSpawnCellDictionary.Add(index, val3); } }
private void OnMoveEnd(CellObject cellObject) { _switchCounter--; cellObject.OnMoveEnd -= OnMoveEnd; cellObject.PinToParent(); if (_switchCounter == 0 && OnSwitchEnd != null) { OnSwitchEnd(this); } }
void SetCellsOccupied(List <Vector2> finalpoints) { foreach (Vector2 point in finalpoints) { CellObject finalCell = getCellAtPos(point); if (finalCell != null) { finalCell.occupied = true; } } }
private CellObject PopulateCellObjectMetadata(Excel.Range cell) { CellObject cellObject = new CellObject(); cellObject.Name = string.Format("{0}!{1}", cell.Worksheet.Name, cell.Address[false, false]); cellObject.Formula = cell.Formula ?? ""; cellObject.Value = cell.Value == null ? "" : cell.Value.ToString(); cellObject.RowHeading = ((cell.Worksheet.Cells[1][cell.Row]).Value == null ? "" : (cell.Worksheet.Cells[1][cell.Row]).Value.ToString()); return(cellObject); }
//移动 private void WindowsList_MouseMove(object sender, MouseEventArgs e) { this.e_x = e.X; if (isMove == 1) { int index = 0; for (int i = 0; i < lstobj.Count; i++) { CellObject obj = lstobj[i]; if (obj.type != 1) { continue; } if (move_form == null) { break; } if (obj.r.X < move_form.r.X) { //往前 if ((obj.r.X + obj.r.Width * 0.5) >= e.X) { index = lst.IndexOf((Form)obj.data); break; } } else if (obj.r.X > move_form.r.X) { //往后 if ((obj.r.X + obj.r.Width * 0.5) <= e.X) { index = lst.IndexOf((Form)obj.data); break; } } } if (index > 0) { for (int i = lst.Count - 1; i > 0; i--) { if (lst[i] == (Form)move_form.data) { lst.RemoveAt(i); break; } } lst.Insert(index, (Form)move_form.data); this.x = e_x; index = 0; } } }
void Start() { m_Grid = new CellObject[m_Rows, m_Columns]; for (int i = 0; i < m_Rows; i++) { for (int j = 0; j < m_Columns; j++) { m_Grid[i, j] = new CellObject(); } } }
public static Cell Create(GameObject prefab, Transform parent, Vector3 position, float size) { GameObject newObject = Instantiate(prefab, parent); newObject.transform.localPosition = position; Cell cell = new Cell(position, newObject.transform.position, size); CellObject cellObject = newObject.GetComponent <CellObject>(); cellObject.cell = cell; return(cell); }
public CellObject DetectCollisionAtMove(Vector2Int move) { CellObject flag = null; foreach (Vector2Int int2 in cells) { if (DetectCollisionAtPos(int2 + ObjectPosition + move) != null) { flag = DetectCollisionAtPos(int2 + ObjectPosition + move); } } return(flag); }
private void Gem_OnShowEnd(CellObject gem) { gem.OnShowEnd -= Gem_OnShowEnd; _filledCells.Add(gem.ParentCell); _filledCellsCount--; if (_filledCellsCount == 0) { if (OnCellsFilled != null) { OnCellsFilled(_filledCells.ToArray()); } _filledCells.Clear(); } }
private void FieldList_MouseClick(object sender, MouseEventArgs e) { foreach (CellObject obj in lstobj) { if (obj.r.Contains(e.X, e.Y) == true) { cur_obj = obj; if (_ItemClick != null) { _ItemClick.Invoke(this, new EventArgs()); } break; } } }