public void SetSceneryCell(Cell cell) { Cell cellFind = SceneryCells.FirstOrDefault(record => record.Location.Equals(cell.Location)); if (cellFind == null) { this.SceneryCells.Add(cell); MapBmpFillRectangle(cell, Color.Goldenrod); } else { cellFind.Name = cell.Name; } }
public Cell GetSceneryCell(int mouseX, int mouseY) { return(SceneryCells.FirstOrDefault(record => record.Location.Equals(new Point(mouseX / this.CELL_WIDTH * CELL_WIDTH, mouseY / this.CELL_WIDTH * CELL_WIDTH)))); }
public string GetSceneryCellName(int mouseX, int mouseY) { Cell cell = SceneryCells.FirstOrDefault(record => record.Location.Equals(new Point(mouseX / this.CELL_WIDTH * CELL_WIDTH, mouseY / this.CELL_WIDTH * CELL_WIDTH))); return(cell == null ? string.Empty : cell.Name); }