Esempio n. 1
0
        private void UpdateDrawPathSequence(PointerEventInfo info)
        {
            if (ActiveTile == null && _activeBrush == null)
            {
                return;
            }

            TileCoord location = TileLocation(info);

            if (!TileInRange(location))
            {
                return;
            }

            if (_activeBrush != null)
            {
                Layer.TileAdding   += TileAddingHandler;
                Layer.TileRemoving += TileRemovingHandler;

                _activeBrush.ApplyBrush(Layer, location.X, location.Y);

                Layer.TileAdding   -= TileAddingHandler;
                Layer.TileRemoving -= TileRemovingHandler;

                /*foreach (LocatedTile tile in _anonBrush.Tiles) {
                 *  TileCoord tileloc = new TileCoord(location.X + tile.X, location.Y + tile.Y);
                 *  if (Layer[tileloc] == null || Layer[tileloc].Top != tile.Tile) {
                 *      _drawCommand.QueueAdd(tileloc, tile.Tile);
                 *      Layer.AddTile(tileloc.X, tileloc.Y, tile.Tile);
                 *  }
                 * }*/
            }
            else if (Layer[location] == null || Layer[location].Top != ActiveTile)
            {
                if (Layer.CanAddTile(location.X, location.Y, ActiveTile))
                {
                    _drawCommand.QueueAdd(location, ActiveTile);
                    Layer.AddTile(location.X, location.Y, ActiveTile);
                }
            }
        }