예제 #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;
            }
        }
예제 #2
0
 public void RemoveSceneryCell(Cell cell)
 {
     SceneryCells.Remove(cell);
     MapBmpFillRectangle(cell, Color.Azure);
 }
예제 #3
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))));
 }
예제 #4
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);
        }