Example #1
0
        /// <summary>
        /// Updates the data from the UI to the selected tile
        /// </summary>
        private void UpdateTileProperty()
        {
            Tile selectedTile = _tileHandler.GetTile(_gridHandler.SelectedTilePoint);

            if (selectedTile == null)
            {
                return;
            }

            TileProperty tileProp = _tileHandler.GetTileProperty(selectedTile.TextureId);

            if (tileProp == null)
            {
                return;
            }

            tileProp.CopyData(TileProperty);
        }
Example #2
0
        /// <summary>
        /// Hits when left mouse button is up
        /// </summary>
        /// <param name="e"></param>
        public void MouseUp(EventArgs e)
        {
            var mouseEvent = (e != null) ? (MouseEventArgs)e : null;

            if (mouseEvent == null)
            {
                return;
            }

            if (_modeHandler.CurrentMode == ModeHandler.MODE.SELECT)
            {
                _gridHandler.SelectedTilePoint = _gridHandler.GetPointFromCoords(mouseEvent.GetPosition(_canvas));
                Tile selectedTile = _tileHandler.GetTile(_gridHandler.SelectedTilePoint);
                if (selectedTile != null)
                {
                    _tileProperty.CopyData(_tileHandler.GetTileProperty(selectedTile.TextureId));
                }
            }

            _mouseDown = false;
        }