Exemple #1
0
        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;
            }
        }
Exemple #2
0
 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))));
 }
Exemple #3
0
        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);
        }